ghd Posted November 21, 2012 Share Posted November 21, 2012 Dear Larry, In the Review and Pursue section of chapter 3 of this great book, you have put a question: Under what circumstances will attempts to enable display_errors in a script not succeed? I searched this forum and the book, but I am unable to find the answer. Could you give me the answer ? Regards, Ganesh Link to comment Share on other sites More sharing options...
Larry Posted November 21, 2012 Share Posted November 21, 2012 Sure thing: if there's a parse error in the script, the code cannot run, and therefore display_errors() will have no effect. Link to comment Share on other sites More sharing options...
ghd Posted November 23, 2012 Author Share Posted November 23, 2012 And, I think that's the reason we need to put that call to display_errors at the very top of the script. The moral to take home is: It's prefereable to have display_errors set in the INI file rather than in the script in a non-production environment. Am I right? Link to comment Share on other sites More sharing options...
Larry Posted November 23, 2012 Share Posted November 23, 2012 Yes and no. If there's a parse error, it makes no difference where you put the call to display_errors. But, yes, it's preferable to change display_errors in the configuration file. Link to comment Share on other sites More sharing options...
BillByrd Posted January 17, 2014 Share Posted January 17, 2014 1. I understand that error in "catch-device" would produce blank page. I pasted this from book: <?php ini_set (' display_errors', 1); ?> Deliberate errors produce blank page. 2. phpinfo(); displays the info; phpinfo(): [colon instead of semicolon] displays the info with no error report; phpinfo( displays blank page Any ideas? Link to comment Share on other sites More sharing options...
Larry Posted January 18, 2014 Share Posted January 18, 2014 I'm not positive why phpinfo(): doesn't produce errors (the other two are logical). I imagine it's because : is an operator in PHP. Link to comment Share on other sites More sharing options...
BillByrd Posted January 18, 2014 Share Posted January 18, 2014 I'm not positive why phpinfo(): doesn't produce errors (the other two are logical). I imagine it's because : is an operator in PHP. But shouldn't <?php ini_set (' display_errors', 1); ?> trigger an error report rather than blank page when one parenthesis missing in the phpinfo? Link to comment Share on other sites More sharing options...
Larry Posted January 21, 2014 Share Posted January 21, 2014 No, because the lack of parentheses is a syntax error. Also, you have an extra space before "display_errors". Link to comment Share on other sites More sharing options...
Recommended Posts