phpapacheapache2fastcgifpm

PHP erorrs not showing


All of a sudden my local machine has stopped showing 500 errors and instead provides a 503. When looking in the error logs also, it displays the error "AH01067: Failed to read FastCGI header" and then "AH01075: Error dispatching request to :" (full errors below)

This never used to happen and used to throw a 500 error and then log what the error was in the error logs.

To test this, I've literally got a PHP file where I am purposely missing out the end semi-colon to try and cause a 500.

My test code to throw the 500:

<?php
echo "Hello"

Full logs of what I'm getting instead of an error:

[Tue Oct 18 10:55:02.139915 2022] [proxy_fcgi:error] [pid 275174] [client 127.0.0.1:47564] AH01067: Failed to read FastCGI header
[Tue Oct 18 10:55:02.139977 2022] [proxy_fcgi:error] [pid 275174] (104)Connection reset by peer: [client 127.0.0.1:47564] AH01075: Error dispatching request to : 

I am using apache2 with PHP 7.3 FPM on a ubuntu 20.04 machine.

The main confusion I think with this is that it worked on Friday and showed me the errors, came in to work on Monday and it is no longer working.


Solution

  • I seem to have resolved this. In my php ini I had the following xdebug parameters:

    xdebug.var_display_max_depth = -1
    

    I have commented this out and it now looks to be working with the page throwing a 500 rather than a 503, and the error logs display the actual php/code error