I have PHP 5.2.10 and PHP 5.2.14 (x86 non-threadsafe Win32 builds) installed on a Windows 2008 R2 server and on Windows 7 64 bit.
For some reason PHP 5.2.14 refuses to show error messages.
Even when I set the following settings in php.ini
I don't get any errors reported if I use 5.2.14:
error_reporting = E_ALL
display_errors = On
This happens even when running a test script from the command line using php.exe
with a deliberate syntax error:
c:\php>
php test.php
PHP is using the correct php.ini
file because I can see my settings change when I run php.exe -i
.
I also notice that php.exe
in PHP 5.2.14 is very slow to start up.
When I perform the same set of tests using PHP 5.2.10 on the same machines I get error messages reported just fine.
Both of the php.ini
files are stock (based off of php.ini-recommended
) but with the error_reporting
and display_errors
settings modified.
I have found this truly annoying, so here's a strategy for checking the syntax from the command line:
php -n -l -d display_errors -d display_startup_errors path/to/your/phpfile.php
$ php -h
-n No php.ini file will be used
-l lint, syntax checking only
-d foo[=bar] Define INI entry foo with value 'bar'