If there is a fatal error – like unable to connect to database, then PHP is printing the error stack in the browser like follows –
mysql_pconnect() [<a href='function.mysql-pconnect'>function.mysql-pconnect</a>]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
#0 /var/www/platform/db/connection.php:12 mysql_pconnect('127.0.0.1','root','password')
#1 /var/www/platform/db/front_page.php:10 open_db_connection()
#2 /var/www/platform/services/front_page_services.php:7 find_top_courses()
#3 /var/www/platform/inc/main.php:75 get_top_courses()
#4 /var/www/index.php:198 F3::run()
How do I prevent this? error_reporting in php.ini has been set to 0 and display_errors to be Off.
Ensure no script is enabling
display_errorsduring run-time or through.htaccess.If that still doesn’t work, be sure you’re modifying the right
php.ini, and restarting Apache/IIS/nginx after any changes are made. If that still fails, load up aphpinfo()and ensure the changes are taking.Also, be sure to turn
html_errorsoff too. Just in case a script sneaks by that changes your error_reporting, and it shows your stack trace to the public.