Troubleshooting HTTP Server Errors
HTTP server errors could mean just about anything, however there are a few files you can check that will usual state what the problem is. The file where the messages are logged may differ depending on the web site, problem, and server. There is also the chance that the problem is not logged if the web application is generating the error itself. Click here to reference different server code errors.
If your site is on a cPanel server, there are a few places to check.
- In your home directory under the logs directory, each domain will have a “example.com.php.error.log” file which contains errors logged by PHP-FPM.
- PHP sometimes create a “error_log” file in the directory which the PHP file exists, you can find all “error_log” files in your account by running “find . -name error_log” over ssh in either your document root or the home directory. You can review the log file by using the “less” command.
- The directory “/usr/local/apache/logs/” contains Apache logs errors which may be useful in solving issues. Common issues found are file permissions and incorrect “.htaccess” file syntax.
Servers running Nginx usually come with PHP-FPM for running PHP code. Depending on the web site’s configuration, errors could be logged in different locations.
- Check the “/var/log/nginx/” directory for “error.log” files. Sometimes, a vhost configuration will store error logs into its own file.
- Check the “/var/log/php-fpm/” directory for errors PHP-FPM logs.
- Check your site’s document root for “error_log” files. In SSH, you can change directory to the document root and run “find . -name error_log” to find these files.
- Check “journalctl -xe” for recent errors potentially related to your problem.
- Verify that PHP-FPM is actually running with “systemctl status php-fpm” over ssh.
There are times when your issue is not a PHP error or even a server error, but is an issue with the web application itself. This could include a maintenance mode being enabled, or even a problem the web application logs to its own log file. As there are many web applications out there, we cannot cover all of them. We can however provide general troubleshooting, which should help you in most web applications.
- Determine if the site is in maintenance mode. If you are unfamiliar with how maintenance mode works in your web application, you can possibly find instructions on the internet. Some web applications use a file with the name containing the word maintenance, some use the database to store the state, and some provide a command line interface (CLI) to put the site in and out of maintenance mode.
- Look for log files. You can run “find . -name ‘*log’” in the document root with SSH to look for log files.
If you are unable to find the reason your site hosted with us is returning a HTTP server error, our team of experts are here to help.