JayBlake Posted May 31, 2007 Share Posted May 31, 2007 I've got a problem so fundamental I can't even say what my error message is because I don't see any errors EVER! If my PHP or MySQL scripts don't work, I just see a blank browser page and have to dig through the code and figure out my problem by brute force. Do I have to set a parameter somewhere or something? I even tried installing a debugger but still I don't see anything (unless it works, of course). I know there is probably a really simple solution but I'm a total newbie to OO programming. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/ Share on other sites More sharing options...
bubblegum.anarchy Posted May 31, 2007 Share Posted May 31, 2007 http://www.php.net/errorfunc Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-265454 Share on other sites More sharing options...
Wildbug Posted May 31, 2007 Share Posted May 31, 2007 error_reporting(E_ALL); // at the top Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-265739 Share on other sites More sharing options...
wildteen88 Posted May 31, 2007 Share Posted May 31, 2007 error_reporting(E_ALL); // at the top You may/will need to also add the following line too at the beginning of your script: ini_set('display_errors', 'On'); Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-265748 Share on other sites More sharing options...
JayBlake Posted June 1, 2007 Author Share Posted June 1, 2007 Thanks for your help but I still don't see any errors after putting in the "error_reporting" line and the "ini_set" line. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-265948 Share on other sites More sharing options...
AndyB Posted June 1, 2007 Share Posted June 1, 2007 <?php ini_set('display_errors', 'On'); error_reporting(E_ALL); echo "wombat; // yes this is an intentional error ?> Save as test.php, upload to your server, and execute it. Tell us what you see on screen and what is seen when you view the html source. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266039 Share on other sites More sharing options...
JayBlake Posted June 1, 2007 Author Share Posted June 1, 2007 Thanks. I typed in that exact code, saved it as test.php, opened my browser and again, nothing but a white screen. I didn't save it to the wrong place, either, because my earlier successful scripts that I saved there work just fine. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266053 Share on other sites More sharing options...
AndyB Posted June 1, 2007 Share Posted June 1, 2007 Your earlier saved scripts work just fine? Including error display? When you browse to them or when you call them from a server as opposed to local navigation with Explorer and double-clicking? Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266066 Share on other sites More sharing options...
JayBlake Posted June 1, 2007 Author Share Posted June 1, 2007 I'm sorry, I meant they work fine if there aren't any errors. If there are errors I just get that blank screen (I even verified that again). I'm using my Internet Explorer browser to run these; I've never uploaded them to a server. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266083 Share on other sites More sharing options...
bubblegum.anarchy Posted June 1, 2007 Share Posted June 1, 2007 Please try the following: if ($original_value = ini_set('display_errors', 'On')) { print "<P>New display_errors value set</P>"; print "<P>Original value: {$original_value}</P>"; } else print "<P>Failed to set display_errors</P>"; The following note is regarding the behaviour of ini_set(display_errors... Note: Although display_errors may be set at runtime (with ini_set()), it won't have any affect if the script has fatal errors. This is because the desired runtime action does not get executed. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266112 Share on other sites More sharing options...
JayBlake Posted June 1, 2007 Author Share Posted June 1, 2007 Thanks, bubblegum, but I put that code in and still it displays nothing. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266579 Share on other sites More sharing options...
bubblegum.anarchy Posted June 2, 2007 Share Posted June 2, 2007 But there is no error with that above code... I even tested the code... something should be printed. Do you have access to the php.ini file? what about this: if ($original_value = @ini_set('display_errors', 'On')) { print "<P>New display_errors value set</P>"; print "<P>Original value: {$original_value}</P>"; } else print "<P>Failed to set display_errors</P>"; Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266599 Share on other sites More sharing options...
JayBlake Posted June 2, 2007 Author Share Posted June 2, 2007 Well, now I've made a tiny bit of progress. I took everything out of my script except for your code and it displays "Failed to set display_errors" (in fact, it does it with the "@" before ini_set or without). So now what do I need to do? And, yes, I do have access to the php.ini file. Should I look for something there? Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266617 Share on other sites More sharing options...
JayBlake Posted June 2, 2007 Author Share Posted June 2, 2007 Now I put the following lines at the beginning: error_reporting(E_ALL); ini_set('display_errors','On'); and it displays "New display_errors values set" along with a good echo message I put in later. HOWEVER, If I corrupt my good echo message with a typo, I again see nothing at all - a completely blank screen, not even the "New display..." message. It's almost as if getting an error turns off my display_errors settings! Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266645 Share on other sites More sharing options...
bubblegum.anarchy Posted June 2, 2007 Share Posted June 2, 2007 What is the error_reporting and display_errors directive set to in php.ini and are they commented out? Your results with the additional calls to error_reporting and ini_set make no sense, pleaes post the exact file contents wrapped in code tags. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266685 Share on other sites More sharing options...
JayBlake Posted June 2, 2007 Author Share Posted June 2, 2007 error_reporting = E_ALL and is not commented out. display_errors = Off and is not commented out. Sorry if those two additional lines I put in make no sense; I was just following AndyB's suggestion. As you requested, here is all my code (I'm not sure what you meant by "wrapped in code tags", sorry): <?php error_reporting(E_ALL); ini_set('display_errors','On'); if ($original_value = ini_set('display_errors', 'On')) { print "<P>New display_errors value set</P>"; print "<P>Original value: {$original_value}</P>"; } else print "<P>Failed to set display_errors</P>"; echo "this is a good test message"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266714 Share on other sites More sharing options...
bubblegum.anarchy Posted June 2, 2007 Share Posted June 2, 2007 ini_set working outside of the if condition and not inside is what does not make sense. Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-266721 Share on other sites More sharing options...
JayBlake Posted June 4, 2007 Author Share Posted June 4, 2007 Thanks for everyone's help but I still have the problem. I'm totally dead in the water 'til I get it solved. Anyone else have any ideas??? Quote Link to comment https://forums.phpfreaks.com/topic/53698-where-are-my-error-messages/#findComment-267874 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.