I have a Ubuntu server running Apache2 with PHP 5. In the php.ini I set display_errors = On
and error_reporting = E_ALL | E_STRICT
, but PHP is st
Although this is old post... i had similar situation that gave me headache. Finally, i figured that i was including sub pages in index.php with "@include ..." "@" hides all errors even if display_errors is ON
For me I solved it by deleting the file of php_errors.txt in the relative folder. Then the file is created automatically again when the code runs next time, and with the errors printed this time.
I had the same problem on my virtual server with Parallels Plesk Panel 10.4.4. The solution was (thanks to Zappa for the idea) setting error_reporting value to 32767 instead of E_ALL. In Plesk: Home > Subscriptions > (Select domain) > Customize > PHP Settings > error_reporting - Enter custom value - 32767
Just want to add another pitfall here in case someone finds this question with a problem similar to mine.
When you are using Chrome (Or Chromium) and PHP triggers an error in PHP code which is located inside of a HTML attribute then Chrome removes the whole HTML element so you can't see the PHP error in your browser.
Here is an example:
<p>
<a href="<?=missingFunc()?>">test</a>
</p>
When calling this code in Chrome you only get a HTML document with the starting <p>
tag. The rest is missing. No error message and no other HTML code after this <p>
. This is not a PHP issue. When you open this page in Firefox then you can see the error message (When viewing the HTML code). So this is a Chrome issue.
Don't know if there is a workaround somewhere. When this happens to you then you have to test the page in Firefox or check the Apache error log.
I had the same issue and finally solved it. My mistake was that I tried to change /etc/php5/cli/php.ini, but then I found another php.ini here: /etc/php5/apache2/php.ini, changed display_errors = On, restarted the web-server and it worked!
May be it would be helpful for someone absent-minded like me.
When you update the configuration in the php.ini file, you might have to restart apache. Try running apachectl restart
or apache2ctl restart
, or something like that.
Also, in you ini file, make sure you have display_errors = on, but only in a development environment, never in a production machine.
Also, the strictest error reporting is exactly what you have cited, E_ALL | E_STRICT
. You can find more information on error levels at the php docs.