unwanted display of error messages
Posted: Sat Aug 08, 2009 9:56 am
I'm forcing an error by purposely leaving out an include file that has db login information in it. When I render the php page, and get to the connection statement
I get the message 'Couldn't connect to server.'
That makes sense. The problem is that I am trying to not have this error display, but instead write the error to a log file that I've specified (which is set up in another directory for security reasons). I have modified the php.ini file so that:
error_reporting = E_ALL
display_errors = Off
log_errors = On
error_log = c:/php/log/phplog.txt
Unfortunately, I still see the error in the browser and it is not written to the log file.
What still needs to be adjusted so that the error is not shown in the browser but is instead written to the log file?
Thanks!
Code: Select all
$cxn = mysqli_connect($host,$user,$password,$dbname)
or die ("Couldn't connect to server.".mysqli_error($cxn));That makes sense. The problem is that I am trying to not have this error display, but instead write the error to a log file that I've specified (which is set up in another directory for security reasons). I have modified the php.ini file so that:
error_reporting = E_ALL
display_errors = Off
log_errors = On
error_log = c:/php/log/phplog.txt
Unfortunately, I still see the error in the browser and it is not written to the log file.
What still needs to be adjusted so that the error is not shown in the browser but is instead written to the log file?
Thanks!