Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I isolate unwanted PHP error messages?

Tags:

php

apache

I am using wamp and need to know why I am getting server error messages appear in all browsers. (see grab). I have turned error display off in php.ini and cannot see anywhere in the httpd.conf file that would be displaying these. I would appreciate some help as to how I can troubleshoot this problem. If anyone requires further code or information, I would be happy to supply at fiddle.

I am using php5.3.5 and apache 2.0.53.

Thanks

enter image description here

like image 856
bollo Avatar asked May 09 '26 13:05

bollo


2 Answers

display_errors is changeable PHP_INI_ALL (documentation).

This means it can be enabled in .htaccess, or in a running script using ini_set(). Check your .htaccess files; note that the server (in default config) checks .htaccess files in parent directories as well - so if your site is in /var/www/example.com/htdocs, check for .htaccess in each of the directories in this path.

like image 60
Piskvor left the building Avatar answered May 11 '26 02:05

Piskvor left the building


Are you sure display_errors isn't being set at runtime by some function in your code? ini_set can be used to set that value at runtime, as shown in this PHP doc example:

<?php
echo ini_get('display_errors');

if (!ini_get('display_errors')) {
    ini_set('display_errors', 1);
}

echo ini_get('display_errors');
?>

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!