By default, any error message in your php script will be visible to site visitors on the browser and will be logged to apache error log file – most commonly in “/var/log/httpd/error.log”. In a production server it is advisable to prevent the error message from appearing on browser and has to be silently sent to a custom log file, specifically created for logging only php error messages. Following these steps might help:

1. Create the file under /var/log –

$touch /var/log/php-error.log

2. change permission to 644 –

$chmod 644 /var/log/php-error.log

3. set ownership –

$chown root.apache /var/log/php-error.log

(if httpd is running under apache, could be www-data, nobody…)

4. Edit /etc/php.ini and make sure the following options are set correctly