How to Enable Error Reporting Using the php.ini File Using cPanel

How to Enable Error Reporting Using the php.ini File Using cPanel

As you all know, WordPress is a PHP-based platform, and it may encounter with some common errors. You need to understand the concept of PHP errors.

While running a WordPress website, you may see different kinds of errors, and most of them include a PHP code. To understand them better, enabling the PHP errors to display on the site is a good troubleshooting technique.

Although a non-techie user may not understand PHP codes, still learning the basics is helpful. There are different methods to accomplish one task.

In this tutorial, you’re going to learn about enabling error reporting using the php.ini file. You can either use cPanel or FTP.

Depending on your choice, you can choose any, but I am going to walk you through using cPanel.

A Step By Step Process to Enable PHP Error Reporting

Now and then, you may see tutorials about fixing an issue using cPanel. Most of the people get confused because every company has a different cPanel layout.

Well, no need to worry. Options available in cPanel are almost similar, companies only use a different design template to match their brand.

Let me start the process.

Step 1:

Login to your cPanel and open the file manager

, which is available in the files’ section. Depending on your web hosting company, you may see an independent file manager icon.

Click to open.

Step 2:

Make sure you open the root directory

. When you click on the file manager, a new tab opens up in the browser, which shows the home directory unless you see a popup to choose the root directory.

You can navigate to pulic_html from the left-hand sidebar.

Step 3:

As you know, for a single domain, all the data resides in the public_html directory, but if you host multiple websites,

you need to open the domain name’s respective folder

.

If you run only one site, search for the php.ini file and right-click to edit. As usual, you can also use the standard Edit link from the cPanel navigation menu.

Step 4:

A popup appears to provide an option to disable encoding.

Click on the Edit button and proceed

.

Step 5:

A new tab appears in the browser.

Scroll down to find the error_reporting code

. You see the coding lines in green because error reporting is disabled right now.

All you need is to remove “;” semi-colon sign in front of error_reporting. Let me show you the code when error reporting is disabled.

;    -Show all errors, exceptfor notices
;
;error_reporting = E_ALL & E_Notice
;

Now, if we remove the semi-colon, the code becomes as follow.

;    -Show all errors, except for notices
;
error_reporting = E_ALL & E_Notice
;

Save the file. Here is the screenshot.

Now, you have successfully enabled the error reporting.

How to Enable Displaying Errors

You have enabled the error_reporting, but to display them, you need to change the value of the display_errors variable.

All you need is to set the value to “On“. Let me show you the code when display_errors is not active.

display_errors = Off

To activate it, change the value, and the code becomes as follow.

display_errors = On

Click on the Save Changes button from the top-right corner of the screen, and you’re done. You have successfully enabled error reporting for your WordPress site.

If you have an error, it’s visible on your site.

Note: After enabling error reporting, even your users can see the PHP errors, so it’s better to enable the maintenance mode.


I Hope You Can Start Troubleshooting PHP Errors

I understand, for a non-techie person, it can be scary to deal with coding and any error related to it. But, at some point, you need to learn.

Enabling error reporting helps you fix the error as soon as possible. You might keep deactivating plugins, but if you know the exact PHP error, you can find its cause in a short amount of time.

Conclusion

Editing the php.ini file is same as you do for .htaccess or wp-config.php. You need to make sure you are looking in the correct root directory.

I hope you can enable error reporting using the method. Keep exploring WordPress.

Check out these top 3 WordPress hosting services:

A2 Hosting
$1.95 /mo
Starting price
Visit A2 Hosting
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.8
  • Pricing
    4.0
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3
HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0

How to Stop WordPress From Displaying PHP Errors Using cPanel

This how-to guide helps you understand the concept of PHP errors and how you can
3 min read
Bruno Mirchevski
Bruno Mirchevski
Hosting Expert

How to Fix Too Many Redirects Issue for a WordPress Website

This how-to guide explains the possible causes and solutions to too many redirec
3 min read
Bruno Mirchevski
Bruno Mirchevski
Hosting Expert

How to Fix Maximum Execution Time Exceeded Error Using wp-config.php

This how-to guide explains an alternative way to increase execution time limit u
3 min read
Bruno Mirchevski
Bruno Mirchevski
Hosting Expert

How to Solve “Maximum Execution Time Exceeded” Error of a WordPress Website

This how-to guide provides the solution to fix Maximum Execution Time Exceeded e
3 min read
Bruno Mirchevski
Bruno Mirchevski
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top