【发布时间】:2016-09-09 19:46:19
【问题描述】:
我正在尝试设置一个安装了 LAMP 的 Centos 服务器。
我已经成功创建了一个 laravel 项目,但是当我打开一个路由 (/) 时,它仍然显示 500 ERROR 我不知道配置哪里出错了。
这是我的 htaccess 文件的样子:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
这是我的 /etc/httpd/conf/httpd.conf 文件的样子:
DocumentRoot "/var/www/html"
#
# Relax access to content within /var/www.
#
<Directory "/var/www">
AllowOverride none
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride none
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
我也安装了所有必需的插件。
我安装了 wordpress,它似乎运行顺利。但我不知道为什么它不能用这个。
这是我的项目 URL http://104.199.222.145/demo2/ 我刚刚做了一个基本的 laravel 安装。
我认为这是某个地方更多的 .htaccess 问题。但不确定。
谢谢!
【问题讨论】:
标签: php apache .htaccess laravel centos7