0

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.

3
  • 1
    can you post the code? sometimes your statements might have @ in front of them which tells PHP to suppress the errors? Commented Dec 3, 2009 at 15:24
  • Check the source (view-source) of the blank page. What does it show? Commented Dec 3, 2009 at 15:25
  • it is real code,i not used @ sign anywhere Commented Dec 4, 2009 at 5:36

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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.
1

how about:

ini_set('display_errors', 1);

?

1 Comment

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

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.

2 Comments

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.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.