How to Use php.ini File to Get Error Reports in WordPress?

How to Use php.ini File to Get Error Reports in WordPress?

WordPress can be complicated to deal with at times. The PHP-based platform runs into several errors, some of which are notoriously difficult to fix. All the errors are accompanied with PHP codes to help you understand more about the error. But these error codes don’t appear on screen by default. You need to make them appear on the site, which is a go-to troubleshooting technique.

In this article, learn how you can use the php.ini file to receive these error reports. You can either use cPanel or FTP for this. But for this tutorial, we’ll be using the cPanel.

Enable PHP Error Reporting

To enable error reporting, there are a few steps you need to follow. Here are those steps:
  • Log in to your cPanel with the necessary credentials.
  • Open the File Manager under the Files section. Some users may have an independent file manager icon. Click on it.
  • After clicking on the File Manager, you’ll be taken to a new tab that’d show you the home directory. You may also see a pop up window, in which case you’d have to select the root directory.
  • On the left-hand side panel, navigate to the public_html directory.
  • If you’re hosting multiple websites, select the domain name you want to receive errors for.
  • Inside the folder, search for php.ini file. Right-click on it to start editing.
  • A popup window will appear which provides an option to disable encoding. You need to click on Edit to proceed further.
  • When a new tab appears, search for “error_reporting” code. If it is in green, then error reporting is disabled.
  • To enable error reporting, remove the “;” sign from the front of the error_reporting. It should turn red.
  • Save the file and exit.
Enable Displaying Errors

You’ve only enabled error reporting. Now you need to display them on screen. For this, you’d have to change the “display_errors” variable. From “Off,” you’d have to change it to “On.”

Save then changes you’ve made and exit. Now once you have errors, you’ll see them on your screen.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma