views:

60

answers:

3

Hi,

I have tried with these code:

error_reporting(E_ALL^E_NOTICE);

ini_set("display_startup_errors","on");
ini_set("track_errors","on");
ini_set("error_reporting","E_ALL^E_NOTICE");

But still errors are not appearing on my script.It just displaying only blank white screen when any error occur.Please guide me.

A: 

It could be that your provider has set PHP errors not to be output, but logged internally. I have experienced this before. In that case, a custom error handler may help you. Before, though, make sure you have no @s in front of any statements and log_errors is on. Also run a phpinfo() to double-check whether all reporting settings are activated.

Also, a completely blank page could be a structural parse error. Check with a simple error-inducing statement like

ecxho("hello world");

first.

Pekka
i not used @ sign .Can you tell how custom error handler can be used here.
Take the myErrorHandler() example in the documentation I linked to. That should work fine.
Pekka
A: 

Is this on your own server? Or shared hosting etc? It's likely that error reporting is turned off at the server level. (The reason is usually 'security' but I don't see how it's really a security issue.)

Either edit your server config (php.ini) if you have access to it, or contact your host. They may be able to provide access to error logs.

DisgruntledGoat
I think the rationale is that public-facing errors can reveal details about the server's filesystem and the framework (if any) that the site uses. This can give someone a leg-up in finding exploits and vulnerabilities in the site or server. With shared hosting, a single vulnerable site can compromise every site on the server.
Lucas Oman
True - I guess I'm looking at it from a "purist" POV in the sense that if there's a security hole, it still exists whether you reveal details about the filesystem or not. Attackers could easily try exploits for all the popular frameworks/software regardless.
DisgruntledGoat
+1  A: 

how about:

ini_set('display_errors', 1);

?

Janek
+1 error_reporting is one thing, displaying errors to the standard output is another.
JP