Here is my code:
echo 'foo';
error_reporting(E_ALL);
echo 'this line doesnt end in a semi colon'
echo 'i should get an error here';
When I run this I get no error.
Not sure how this can be?
ini_set('display_errors', 1);
Do note though that if you do this in the file that has the syntax error, it won't work, as it'll never get executed then. You can also set this true in php.ini (not recommended for production servers), or if you use Apache, in .htaccess with:
php_flag display_errors 1
error_reporting configuration value determines what errors are displayed.error_reporting directive won't help you to show error messages on-screen. It's responsible for which error to show, not where.
if your PHP runs as Apache module (most likely it does) add the following line into .htaccess file:
php_value display_errors 1
when you switch to production, change it to
php_value display_errors 0
php_value log_errors 1
and watch them it in the error log.
tail -fthe error log? :-)I get no error.meansI get all 3 lines printedorI get a blank screen?php_flag dislay errors 1. Which at first didn't work. Then I added<Directory "/var/www/aquaplatinum">Order allow,deny Allow from all AllowOverride All </Directory>To my apache2.conf file and restarted apache and now the errors are showing.E_ALL|E_STRICTbut i dont want warning ouput fudging the xhtml. Plus, im normally runningtaildirectly in an Eclipse as an external tool :-)