Php Error To Screen
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss error reporting php ini the workings and policies of this site About Us Learn more about php error reporting all Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Php Display_errors
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other.
Php Error Types
Join them; it only takes a minute: Sign up PHP's white screen of death up vote 55 down vote favorite 29 Now that I'm starting to get back into PHP, I'm starting to remember why I gave it up in the first place. The most annoying thing on my plate at the moment is what I've come to php hide errors term "PHP's white screen of death". When PHP gets a fatal error due to syntax or whatever, it seems like it will always die without actually sending anything to the browser. I've added the following to my .htaccess, and it seems to work most of the time, but it doesn't work in these cases. php_value display_errors 1 php_value display_startup_errors 1 php_value error_reporting 2147483647 # E_ALL Am I missing something? At the moment I feel like I need to hit refresh every few lines of code I write, lest I make a mistake and have to search through many pages trying to track down that one little mistake I made... EDIT: For example, given the two lines of code below: $foo = array(':language' => $languageId; $foo = array(':language' => $languageId); The first will exhibit the white screen of death (ie, nothing at all printed to the browser), while the second will execute happily. php error-handling error-reporting wsod share|improve this question edited Dec 10 '12 at 5:23 hakre 134k26216390 asked Sep 25 '09 at 3:36 Matt
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Php Error Reporting Not Working
about Stack Overflow the company Business Learn more about hiring developers or posting php display errors off ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack php error message Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to get useful error messages in PHP? up vote 369 http://stackoverflow.com/questions/1475297/phps-white-screen-of-death down vote favorite 168 I find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely. It is very difficult to figure out what went wrong. I end up commenting http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php out code, entering "echo" statements everywhere, etc. trying to narrow down the problem. But there surely must be a better way, right?. So, is there a way to get PHP to produce useful error message like Java does? Can anyone recommend good PHP debugging tips, tools and techniques? php debugging error-handling share|improve this question edited May 11 '13 at 23:52 hkBattousai 3,67183982 asked May 10 '09 at 9:48 Candidasa 2,95982330 coding.smashingmagazine.com/2011/11/30/… –Alex Jul 15 '12 at 14:54 1 Also see stackoverflow.com/q/1475297/632951 –Pacerier Oct 14 '14 at 9:37 @JuannStrauss, That's understating it. And when you finally see the errors, it says T_PAAMAYIM_NEKUDOTAYIM. Or maybe "must be an instance of integer, integer given". –Pacerier Apr 3 '15 at 20:02 Tutorial on this: code2real.blogspot.com/2015/06/… –Pupil Sep 9 '15 at 7:21 add a comment| 27 Answers 27 active oldest votes up vote 355 down vote accepted For syntax errors, you need to enable error display in the php.ini. By default these are turned off because you don't want a "customer" seeing the error messages. Check this page in the PHP documentation for information on the 2 directives: error_reporting and display_errors. display_errors is probably the one you want to change. If y
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring http://drupal.stackexchange.com/questions/7560/how-to-see-the-error-messages-when-i-get-the-white-screen-of-death developers or posting ads with us Drupal Answers Questions Tags Users Badges Unanswered Ask Question _ Drupal Answers is a question and answer site for Drupal developers and administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top How to see the error messages when I get the white screen of death? up vote 20 php error down vote favorite 6 How can I see the error messages when the site I am working on gets a white screen? wsod share|improve this question edited Oct 2 '13 at 14:12 kiamlaluno♦ 66.7k898194 asked Jul 21 '11 at 18:36 sokratis 1,18632338 add a comment| 5 Answers 5 active oldest votes up vote 27 down vote accepted Put this at the bottom of settings.php: error_reporting(-1); // Have PHP complain about absolutely everything $conf['error_level'] = 2; // Show all messages php error reporting on your screen, 2 = ERROR_REPORTING_DISPLAY_ALL. ini_set('display_errors', TRUE); // These lines just give you content on WSOD pages. ini_set('display_startup_errors', TRUE); share|improve this answer answered Jul 21 '11 at 18:39 Mike 85211026 This is great for development sites though I prefer /var/log/apache2/error.log for live sites. This works though. :) –Citricguy Feb 3 '12 at 5:25 add a comment| up vote 16 down vote The White Screen of Death (Completely Blank Page) resource on drupal.org will step you through the steps to see the error message as well as common problems that cause them. "Invisible" Errors If error reporting is turned off, you could be getting a fatal error but not seeing it. On a production site, it is common to have error reporting turned off. If that is the case and PHP has hit an unrecoverable error, neither an error nor content will be displayed, therefore you end up with a completely blank page. What you can do about this is either turn on PHP error reporting so it displays a message on the page itself, or check your log files (from the server) to look for the error. How to do both of these are explained below. Enable Error Reporting Although it may be turned off on commercial hosts and production sites (for good reason, so that users do not see the errors), these errors are one of your best tools for troub