If your application/script is not working as expected and you're not sure why, a great way to debug this would be to enable error reporting in PHP through your .htaccess. For purposes of this article we'll show instructions using cPanels built in File Manager, however these same steps can be achieved through SSH or an FTP client (we suggest FileZilla). To enable PHP error reporting:
- Login to cPanel for your account, and in the top left finder search for File Manager. (Picture)
- Select the File Manager icon, and you'll be greeted with a popup. On this dialogue, you'll want to select 'Web Root' for the directory also select 'Show Hidden Files (dotfiles)'. (Picture)
- Once your File Manager opens, locate your .htaccess file and click it. Once highlighted, select 'Edit' from the top navigation. You will be prompted with another dialogue box, just hit 'Edit' to continue to the editor. (Picture)
- Now that you're editing your .htaccess, add the following lines to your file: (Picture)
php_flag display_errors on
php_value error_reporting "E_ALL & ~E_STRICT & ~E_NOTICE"
This will display errors from your PHP sites/applications to help debug any error(s) you're running into.