views:

173

answers:

2

Hello all,

I have checked my PHP ini file and display errors is set and also error reporting is E_ALL. I have restarted my apache web server. I have even put these lines at the top of my script and it doesn't even catch simple parse errors. For example, I declare variables with a "$" and I don't close statements ";". But all my scripts show a blank page on these errors, but i want to actually see the errors in my browser output.

error_reporting(E_ALL);
ini_set('display_errors', 1);

What is left to do?

Thanks all

+4  A: 

You can't catch parse errors when enabling error output at runtime, because it parses the file before actually executing anything (and since it encounters an error during this, it won't execute anything). You'll need to change the actual server configuration so that display_errors is on and the approriate error_reporting level is used. If you don't have access to php.ini, you may be able to use .htaccess or similar, depending on the server.

This question may provide additional info.

Michael Madsen
Did not know that. I edited the php.ini file manually and it is working now. Thanks!
Abs
A: 

Or try using:

ini_set('display_startup_errors', 1);

http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-startup-errors

Erik
That refers to errors occuring when PHP starts up; something you basically never want to see. It has nothing to do with your own code.
Michael Madsen