【问题标题】:laravel 5.4 error 500laravel 5.4 错误 500
【发布时间】:2017-08-20 23:31:39
【问题描述】:

几个小时前,我在网上发布了一个博客,但我的链接不起作用。我只能看到主页。如果我点击菜单,我会收到错误 500。网站 4thquarter.alexandrehamed.com 的链接,数据库是空的,所以如果看起来什么都没有,这是正常的

感谢您的帮助(对不起,我的帖子看起来很乱)

这里是我的 htaccess 文件的屏幕

exemple of i have route.php:
Route::get('',[
    'uses' =>'BlogController@Index',
    'as' =>'home.content'
]);
Route::get('/blog/{post}',[
    'uses' => 'BlogController@show',
    'as' => 'home.show',
]);

Route::get('/statistiques',[
   'uses' => 'BlogController@stats',
    'as' => 'home.stats'

【问题讨论】:

  • 500 可能意味着任何事情。您需要查看 Web 服务器日志文件。

标签: laravel .htaccess laravel-5


【解决方案1】:

我找到了这个 htaccess 的解决方案

DirectoryIndex index.php

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .? - [L]

    RewriteRule .? %{ENV:BASE}/index.php [L]

</IfModule>

【讨论】:

    【解决方案2】:

    查看您的日志文件 - storage/logs/laravel.log。您可能没有在您的环境中设置APP_KEY。如果是这种情况,请使用php artisan key:generate --show 生成一个并将其弹出到您的.env 文件中。

    【讨论】:

      猜你喜欢
      • 2017-12-13
      • 2017-09-01
      • 2019-05-12
      • 1970-01-01
      • 2017-11-15
      • 1970-01-01
      • 1970-01-01
      • 2018-05-03
      • 1970-01-01
      相关资源
      最近更新 更多