我在Laravel 4中有项目。它位于bitbucket上。我从我的本地机器上的回购下载了本地虚拟主机,工作正常。但是,当我在我的服务器上克隆相同的项目并创建虚拟主机时,会显示500内部服务器错误。在同一个域上,laravel 5中同一个项目的另一个虚拟主机工作正常。500内部服务器错误Laravel 4
这是laravel 4项目我的虚拟主机文件代码:
<VirtualHost *:80>
ServerAdmin [email protected]
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
看看Apache的错误日志。它将包含详细的消息有什么不对。 –
在哪里可以找到apache日志? – MKJ
这取决于您的系统。查看Apache配置如何定义$ {APACHE_LOG_DIR}。 –