Use the following settings in your php.ini file:
error_reporting = E_ALL
display_errors = On
And optionally, use these settings to log errors to a log file:
log_errors = On
error_log = "/path/to/php_error.log"
For security, make sure the following value is set:
This lets will make PHP print errors to the screen (and optionally to the logs), including line numbers. Without this type of verbose output, it is virtually impossible to tell if your scripts are having problems, let alone diagnose them. On a shared hosting environment, you will probably not have any control over the contents of the php.ini file, but you can include a line in your scripts to change the error reporting level:
Some setups allow you to use your own local php.ini file to override system settings found in the main php.ini file. Check with your host for details.