How to Access PHP Error Logs in WordPress
Having a code problem with your WordPress site?
There’s a significant chance that the answer can be found in a PHP error log.
Often these error logs are available via hosting company control panels, but also there are many users who can’t access them. In this guide, I’ll show you how to set up your own PHP error log.
- Install the plugin “WP Log Viewer”.
- Click the “Debug Log” link in your top admin menu.
- You’ll probably see this message below: “Debugging is currently disabled”.
- Log in to your WordPress site files. If you can’t access your hosting company’s control panel, you’ll likely need to use FTP access.
- Browse to the wp-config.php file that is sitting at the same level as your /wp-admin/ and /wp-content/ files.
- Add the lines you saw above into your wp-config.file.
- Save the file.
- Open the /wp-content/ folder.
- Create a file called debug.log
- Return to your WordPress admin.
- Browse around. You may start to see a warning icon in the top admin menu. In this case the icon says “2”.
- Go to the Log Viewer and you’ll see a list of all the errors and warnings on your site. Click here for an explanation of the difference between errors and warnings.