How to enable the "display_errors" option to show PHP error messages Print

  • 0

In cPanel, you can enable the "display_errors" option to show PHP error messages directly in the browser. This can be helpful for debugging purposes, but it's important to remember to disable this feature when you're finished, as displaying errors on a live site can expose sensitive information and pose a security risk.

To enable the "display_errors" option in cPanel, follow these steps:

  1. Log in to your cPanel account.

  2. Locate the "Software" or "Advanced" section and click on the "MultiPHP INI Editor" or "Select PHP Version" icon (the location of this feature might vary depending on your cPanel version or web host).

  3. If you've selected "MultiPHP INI Editor," choose the "Editor Mode" tab. If you've selected "Select PHP Version," click on the "Switch to PHP Options" link or the "Options" tab.

  4. In the list of PHP settings, find the "display_errors" option.

  5. Click on the current value (usually "Off" by default) and change it to "On" using the drop-down menu.

  6. Click the "Save" or "Apply" button to save the changes.

Now, when your website encounters PHP errors, the error messages will be displayed directly in the browser.

When you've finished debugging, remember to disable the "display_errors" option by following the same steps and setting the value back to "Off." Additionally, you may want to enable error logging in your php.ini or .user.ini file by setting the "log_errors" option to "On" and specifying an error log file (e.g., "error_log = /home/your_username/public_html/error_log.txt"). This way, errors will be logged in a file rather than displayed in the browser.


Was this answer helpful?

« Back