Where to find PHP Error Logs

The PHP error logs can be located in various locations on your server:

  1. In your server’s root folder, it is typically named error.log.
  2. In the public_html or a similar folder, it is usually named error.log.
  3. In the var/logs or a similar directory, it is named error.log.
  4. Additionally, if you have debugging enabled in WordPress and the logs are saved to a file, you can find it in the wp-content folder named debug.log.

If you are having trouble locating the file, you can use the following steps to have PHP provide the file path:

  1. Create a file called phpinfo.php in the root directory of your WordPress installation.
  2. Open the phpinfo.php file using a text editor.
  3. Insert the following code into the file: <?php phpinfo(); ?>
  4. Save and close the file.
  5. Access the file on your website. For example, if your site’s URL is example.com, you can open the file by visiting http://example.com/phpinfo.php.
  6. Search the page for the error_log value. The file path mentioned here represents the absolute file path of the PHP error log. By visiting that address on your server, you should be able to locate the PHP error log file. If the value is empty, you need to configure your site to log errors. Refer to the image below for a visual representation of how it should appear: