最佳答案
我的 Laravel 站点之前是可以工作的,我最近升级到了 Apache 2.4和 PHP 5.5.7。
现在当我转到 laravel.mydomain.example
时,我得到了一个白色的空白屏幕,Apache 的错误日志、路由等应该没有什么问题,因为它以前是可以工作的。
当我向 /var/sites/laravel/public/.htaccess
插入一个无效的行时,.htaccess
正在加载,因为我得到了一个500。
这是我的 .htaccess
:
$ cat /var/sites/laravel/public/.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
下面是我的虚拟主机指令:
DocumentRoot "/var/sites/laravel/public"
ServerName laravel.mydomain.example
<Directory "/var/sites/laravel/public">
AllowOverride All
allow from all
Options +Indexes
Require all granted
</Directory>
还有阿帕切特
$ /usr/local/apache2/bin/apachectl -S
VirtualHost configuration:
*:* is a NameVirtualHost
default server mydomain.example (/usr/local/apache2/conf/extra/httpd-vhosts.conf:25)
port * namevhost mydomain.example (/usr/local/apache2/conf/extra/httpd-vhosts.conf:25)
port * namevhost laravel.mydomain.example (/usr/local/apache2/conf/extra/httpd- vhosts.conf:34)
ServerRoot: "/usr/local/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/usr/local/apache2/logs/error_log"
Mutex rewrite-map: using_defaults
Mutex default: dir="/usr/local/apache2/logs/" mechanism=default
PidFile: "/usr/local/apache2/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="daemon" id=1 not_used
Group: name="daemon" id=1 not_used