The PHP error logs can be located in various locations on your server:
- In your server’s root folder, it is typically named error.log.
- In the public_html or a similar folder, it is usually named error.log.
- In the var/logs or a similar directory, it is named error.log.
- 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:
- Create a file called phpinfo.php in the root directory of your WordPress installation.
- Open the phpinfo.php file using a text editor.
- Insert the following code into the file: <?php phpinfo(); ?>
- Save and close the file.
- 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.
- 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: