Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ben82923's avatar

Only Error 500 - Cannot figure out why - not the usual suspects?

In a Vagrant Homestead environment (in Windows via VMware) I can't seem to get a more useful output that the basic error 500 when some scripts have issues. When I forget a necessary "use" or make some other major error, I get the bare Error 500, no additional information. It is making it impossible to debug. For many errors (like forgetting to pass a blade template a variable or failing to specify a route when I call route() I DO get the normal Laravel error page). But for these other errors nothing.

I have gone through every Google result I can find and tried everything I know of, specifically:

  • Reset permissions of storage dir
  • Reset permissions of bootstrap/cache dir
  • Cleared various cache directories
  • Checked Laravel log (nothing in it about the failed event at all - which seems odd)
  • Checked nginx log (nothing in it about the failed event at all - which seems odd)
  • Checked FPM log (nothing in it about the failed event at all)
  • Tried inserting my own exception code, per some people's posts, it never is executed/shown
  • Tried inserting old error_reporting(E_ALL); ini_set("display_errors", 1); include("file_with_errors.php"); in a few different places per other posts -- nothing.
  • Tried resetting the encryption key since someone said that might be an issue (why I don't know) -- nothing
  • Tried reverting back to a backup of a week ago to undo symphony/etc. upgrades -- nothing
  • Tried composer update -- nothing
  • Tried php artisan optimize -- nothing
  • My APP_DEBUG setting is right (and again working appropriately on many errors just not certain ones, like missing "use")

My project has ground to a halt because I can't debug even basic issues, and I'm out of ideas for what to try.

Any help greatly appreciated. There has to at least be some easy way I can get the good old native PHP errors back, but I don't know it.

0 likes
6 replies
davidfaux's avatar

Shot in the dark... make sure none of your entries in the .env file have any spaces and confirm that the laravel.log file is definitely writable by performing a tail on it

ben82923's avatar

@davidfaux, I checked .env file and no spaces, and I deleted and recreated laravel.log and the permissions are:

-rwxrwxrwx 1 vagrant vagrant 0 Jan 16 16:18 laravel.log

But, when I click around the site to pages that work as well as the ones that give 500, nothing is written to the laravel.log. Is that normal? ENV log level is set to debug. I assume from the manual that debug is the broadest logging level.

lara25260's avatar

Your php application will generate the log for these errors.

EX: Apache, Mamp, Lamp.

lara25260's avatar

Error 500 is a php error not a framework error hence why not logs show on laravel.

lvismer's avatar

You can create a info.php to check your php settings.

<?php 
phpinfo();

You can then try to specifically set the following inside your php.ini depending on your specific location:

error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On

Then if you edit your IndexController and force a 500 error like:

class IndexController extends Controller
{
    public function index()
    {
        // Should display a whoops screen for "undefined constant"
        forcing_a_500;
    }
}
ben82923's avatar

CrushCandy, Ivismer, and davidfaux,

Thank you for the help. I suddenly fell ill with a wicked flu and am still trying to make my way back online. I will try your suggestions in a few days once I'm functional again.

In the meantime I can say I finally did find a location where the errors were being logged, thank goodness, the FPM log. I had no idea. But something about my setup still seems wrong because I don't see why I'm not getting a sophisticated Whoops-ish Laravel error page in those cases (missing Use), but I do in other cases (blade error). Maybe that's just how Laravel is, I'm relatively new to it, and certainly to 5.3.

Please or to participate in this conversation.