我在共享HostGator服务器上部署了Laravel 4应用程序。Laravel 4 HostGator上的内部服务器错误500
当我浏览到:
http://mydomain.com/laravel/public/
我可以看到Laravel闪屏。
但是当我尝试访问任何其他途径,比如,/用户/或帖子我越来越
Internal Server Error 500
http://mydomain.com/laravel/public/posts
控制器:
public function index()
{
$posts = $this->post->all();
return View::make('posts.index', compact('posts'));
}
在routes.php文件:
Route::resource('posts', 'PostsController');
我使用Jeffrey Way的Generator来支撑职位实体。
同样在我的本地机器上正常工作。控制器不包含任何逻辑,它们只输出提取的数据。
错误日志为空。
任何想法要检查什么? .htaccess,也许? 这里是我有:
AddType application/x-httpd-php53 .php
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
</IfModule>
没有服务器日志的500错误肯定是.htaccess。它也可能会丢失诸如PDO或mcrypt之类的php扩展(通常只有隐藏才会出现这种情况)如果php抑制错误 - 我不认为Laravel会这样做)。尝试将index.php文件添加到URL中,然后删除您的htaccess文件以测试htaccess文件是否是问题。 – fideloper
你是对的@fideloper,删除一切从的.htaccess除非该指令使用PHP 5.3,使应用程序的工作: 将AddType应用/的X的httpd-php53 .PHP 当然,现在的URL必须包括的index.php 在我的情况:mydomain.com/laravel/public/index.php/posts 所以,现在我知道.htaccess导致的问题,任何人都可以提出修复它? –
我在这里找到了解决方案:http://stackoverflow.com/a/16116678/385402 –