【发布时间】:2016-05-24 05:28:43
【问题描述】:
我花了一个晚上在主机上运行我的 laravel 应用程序。
在 mac os 上的 localhost 中一切正常,但在 ubuntu 上托管时出现 500 错误。
我没有任何线索。
.htaccess 在根目录
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
# Deny accessing below extensions
<Files ~ "(\.json|\.lock|\.git)">
Order allow,deny
Deny from all
</Files>
# Deny accessing dot files
RewriteRule (^\.|/\.) - [F]
和公开的.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteBase /
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
如果我删除 /public/.htaccess 我会得到server error 500
否则我会得到Server error
The website encountered an error while retrieving http://oboi.spb.ru/. It may be down for maintenance or configured incorrectly.
【问题讨论】:
-
您无法将 Apache 的 DocumentRoot 设置为服务器上的
public目录吗? -
你得到 laravel 的 500 错误吗?你能启用调试并显示错误吗?
-
查看文件夹权限(存储、日志)
storage文件夹应该有app、framework、logs和bootstrap/cache -
@Bogdan,我无法在 tis 托管中使用 DocumentRoot,另一个站点工作正常
-
@EduardoPacios,我得到 laravel 的 500 错误。 storege/logs/laravel.log 没有机会
标签: php .htaccess laravel laravel-5