Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP error message switch 1

Status
Not open for further replies.

DaveC426913

Programmer
Jul 28, 2003
274
CA
I'm developing PHP on my Webhost, but I'm not getting any messages back when there are errors, I just get blank pages. I know there's a setting that displays error messages in my browser.

Tech Support told me to do this: error_reporting(E_ALL) but that's not doing the trick (I use this setting at work when I'm looking for specific errors).

I also tried this: echo ini_set("display_errors", "1"); with no luck.

There is a very basic setting that displays things like syntax errors in my browser: (Error: unexpected t_variable near line 100) - tghat kind of thing. How do I express that to the Tech Support guys?

 
they have given you the right information with error_reporting(E_ALL). this overrides the ini setting other than for explicitly suppressed errors.

if you are just getting blank screens on all php pages then the issue is with the php installation or you may be causing a fatal error in your code early on in the script and suppressing the errors explicitly by prefixing an ampersat to the function call.

to test the php installation upload a file with a php extension and just the following code within:
Code:
<? phpinfo(); ?>

point your browser at it. if you get lots of nice data then php is working ok.

if not then it's time to talk to your host about a dodgy installation.

if php is working then it's time to look at your code - by all means post it back to this forum if you want us to help you debug it.
 
if you are just getting blank screens on all php pages then the issue is with the php installation or you may be causing a fatal error in your code early on in the script and suppressing the errors explicitly by prefixing an ampersat to the function call."

Sorry, yes, I only get the blank scrfeens if there's an error in my code (and it dsoesn't have to be a fatal one).

This is the code I've got now:

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

It works OK unless there's a fatal error.
 
try this instead
Code:
error_reporting(E_ALL);
ini_set("display_errors", "1"); //ie value is a string

but bear in mind again that this will not override explicitly suppressed errors or errors that you are trapping with a custom error handling class.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top