我在Laravel 4有项目。它在bitbucket上。我已经从我的本地机器上的repo下载了它,创建了一个本地虚拟主机,工作正常。但是当我在我的服务器上克隆同一个项目并创建了一个虚拟主机时,会显示500内部服务器错误。在同一个域中,laravel 5中同一项目的另一个虚拟主机工作正常。
这是laravel 4项目的虚拟主机文件代码:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName l4.mydomain
ServerAlias l4.mydomain
DocumentRoot /var/www/L4/public
<Directory /var/www/L4/public/>
AllowOverride All
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
这是laravel 4项目的.htaccess代码:
IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我还将'index.php'更改为644权限,但没有工作
这是日志文件中的警告和错误:
PHP Warning: require(/var/www/myproject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/L4/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/var/www/myproject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/L4/bootstrap/autoload.php on line 17
答案 0 :(得分:0)
如果你正在
"PHP Fatal error: require(): Failed opening required '/var/www/L4/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/L4/bootstrap/autoload.php on line 17"
在你的错误日志中,我会说你好像从未在服务器上运行过composer install。