How to Enable PHP Error Display on cPanel

Sometimes when you are working with a PHP script on your website, you may need to debug a problem. By default your server will have PHP error display turned off for security reasons, but you can temporarily enable error display if you need it. Here's how to do it:

Please be aware that some PHP scripts suppress or re-route errors regardless of your settings below. Check with your PHP script documentation to see where error messages get logged if the steps below don't work. You may need to turn on error reporting or logging in the admin area/config file for the script you want to debug.

 

  1. Log into your cPanel account.
  2. Look for the MultiPHP INI Editor in the Software section of cPanel.
    Click on the MultiPHP INI Editor Option in cPanel
  3. Select the domain or subdomain you want to activate error reporting within. The domain or subdomain you pick should be the one that the PHP script is running in.
  4. Locate the ''display error'' tab and click on Enable

    The error_reporting line above will show all errors, notices and warnings for PHP scripts in that domain or subdomain. You can use one or more constants listed here separated by an ampersand (&) if you want to fine-tune the types of errors that get reported.

  5. Click Save to apply the changes you've just made.

NOTE: Now you can access your PHP script and debug it. The errors you are looking for may be displayed on screen, written to an error_log file in the script's main directory or where ever the script chooses to write such errors (perhaps a log accessible from the admin area of the script).

Once you have fixed the issues reported by your PHP script, make sure you disable error reporting by going into the editor in cPanel and  set display_errors = Off
  • cPanel Guide
  • 0 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

How to Select PHP Version In cPanel

Login to your cPanel account Click on Select PHP version Select the version required and...

How To Check cPanel Login Logs

cPanel login logs are records that track and document login activities on a cPanel hosting...

How to Check Your Website’s Error Log in cPanel

If your website is not functioning or there is an error the first thing to check is the error...

Powered by WHMCompleteSolution