Inspecting PHP error log - cause of Internal Server Error (5xx) because of limitation in PHP values

Post Reply
User avatar
isscbta
Team Member
Posts: 129
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 14 times
Been thanked: 3 times

Quick way to see why some site is experiencing 5xx error is:

Code: Select all

grep 'Fatal' /var/log/apache2/domains/YOURDOMAIN.COM.error.log
If we see:

Code: Select all

[Tue Oct 04 01:20:00.425656 2022] [proxy_fcgi:error] [pid 26104:tid 140062074345216] [client 188.2.33.232:41298] AH01067: Failed to read FastCGI header, referer: https://domain.com/dup-installer/main.installer.php
[Tue Oct 04 01:20:00.425674 2022] [proxy_fcgi:error] [pid 26104:tid 140062074345216] (104)Connection reset by peer: [client 188.2.33.232:41298] AH01075: Error dispatching request to : , referer: https://domain.com/dup-installer/main.installer.php
Error dispatching indicates that problem is probably in the request_terminate_timeout value (value from pool.d conf file) or process died because of some internal PHP error.

So for more information we should inspect /var/log/phpX.X-fpm.log - see this tutorial -> viewtopic.php?f=18&t=752



Other reason can be reaching the maximum execution time:

Code: Select all

PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/username/web/domain.com/public_html/wp-content/plugins/wp-smushit/core/modules/helpers/class-parser.php on line 179'
In that case you can increase both max_execution_time and request_terminate_timeout by following this tutorial: viewtopic.php?f=18&t=54



Other reason can be memory_limit:

Code: Select all

PHP Fatal error:  Allowed memory size of 67108864 bytes exhausted (tried to allocate 20480 bytes) in /home/username/web/domain.com/public_html/wp-admin/includes/template.php on line 1653
In order to prevent this error, we should increase value for memory_limit.

Here you can read more about where and how to do that: viewtopic.php?p=172#p172

Tags:
mckaygerhard
Posts: 20
Joined: Thu Jun 08, 2023 6:32 pm
Been thanked: 1 time

i have similar problem but when i try to deploy a laravel crap project.. noted that the templates for apache already points root document to public but still have a 500 too many redirects error.. the installation included nginx proxy ..
Post Reply