How to debug Laravel error 500 with no logs, no information

后端 未结 5 1222
执念已碎
执念已碎 2021-02-07 13:37

I\'m working on an existing Laravel application in order to develop new feature but after installing the app on my computer, I have an error 500 and no clue to resolve it.

相关标签:
5条回答
  • 2021-02-07 14:11

    I had simiar issue (saw error 500, but logs were present).

    In order to be able to see errors directly on the page, I did following changes:

    1. enable debug mode: APP_DEBUG=true
    2. reload configuration: php artisan config:cache
    0 讨论(0)
  • 2021-02-07 14:13

    Next to looking into your .env file, make sure permissions are correctly set (and good practice to create the storage/logs folder(s) manually - at least on windows that causes problems).

    0 讨论(0)
  • 2021-02-07 14:15

    I tried to everything to find out the issue like enabling error reporting to report all like :

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    

    Also i tried to add my custom error handler as well but nothing worked for me. So finally i found the actual issue in php error log file in apache error logs folder (Applications/MAMP/logs as am using Mac).

    0 讨论(0)
  • 2021-02-07 14:28

    Some PHP exceptions are not possible to catch, so Laravel cant handle them. For example syntax errors, or maximum memory limit errors.

    The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.

    Ref.: http://php.net/manual/en/function.set-error-handler.php

    0 讨论(0)
  • 2021-02-07 14:33

    Check your .htaccess file in your public folder! - This hot-fix is host dependent!!!

    Change line from:

    RewriteRule ^ index.php [L]
    

    To:

    RewriteRule ^ /index.php [L]
    
    0 讨论(0)
提交回复
热议问题