You can not fix an error if you don't know what it is. Believe it or not, being told of errors is a good thing, otherwise you would have a problem and no way of knowing there is a problem. PHP provides multiple ways of informing you of errors that occur in your scripts.
php.ini
There are a number of settings you can play with in the php.ini file that deal with error reporting. Settings made in php.ini affect ALL PHP scripts running on the server, not just yours. All the settings have documentation to help you customize it (check out the PHP manual). There is of course the error_reporting setting, but there is also display_error, log_errors, and the error_log settings. The display_error setting is just whether or not to display any error messages on the screen, which is typically set to false on production servers. Instead, error messages can be logged to a specific log file by setting log_errors and error_log.
Script
If you don't have access to the php.ini file that runs on your server--have no fear. You still can have some control over error reporting. The simplest way to make sure you can see all the errors in your specific script is to not suppress them with @. If you absolutely must use the @, add it AFTER all debugging and testing of your script. After that, set your scripts error_reporting() to E_ALL (or E_ALL | E_STRICT for PHP5). We can use the following example in our code to redirect all errors to a logfile outside a web accessible directory when we’re in production: