1

I have a really, really weird situation here. I'm working on a local development server with Zend Server installed. I have full error reporting and display errors, but I'm still getting a white page. Of course, I understand that i've done something wrong, but i want to have an idea WHAT it is i've done wrong.

The system i'm currently working on depends heavily on classes, includes and so on, therefore i can't simply "check" a page (i.e. run it standalone, outside the system, call it directly and stuff). That just won't work.

I've checked the syntax, that's not the problem. I'm stuck, and want to see my errors. If you have any ideas, please tell me!


Just to make clear, I'm already using the following:

ini_set('display_errors', true); error_reporting(-1);


After using an own error handler (php.net/set_error_handler) and some hard debugging (echo's, exits and so on), i found out that i was overruling a variable that was used later on. The variable used to be an object, but was now an int. Weird though that there wasn't any error about the fact that i was calling a function on non-object...

Very weird, but i'm glad that i've found the bug in my application.

Sergio
  • 28,539
  • 11
  • 85
  • 132
ChrisH
  • 1,283
  • 1
  • 9
  • 22
  • Have you tried the stuff in this blog post? http://www.devcha.com/2007/02/enable-php-error-logging.html – Jeroen Baert May 24 '11 at 08:03
  • check the apache access logs, and the php error logs. also, look at the php.ini and see what the settings are for logging and error reporting. – Anony372 May 24 '11 at 08:06
  • Are you calling any functions that mess with the buffer, i.e. flush() ? or any other messing with the datastream (like, mod_gzip on apache) etc.? – colinross May 24 '11 at 08:10
  • @Ericson578, access and error logs aren't showing anything ordinary. Access log displays a 200 request, error log nothing. – ChrisH May 24 '11 at 08:12
  • @Colinross, no flushes are used! But thanks for the tip! – ChrisH May 24 '11 at 08:12
  • duplicate: http://stackoverflow.com/questions/1475297/phps-white-screen-of-death/1476688#1476688 – Quamis May 24 '11 at 08:13
  • I'll make the assumption that by "whitepage", you mean absolutely no source is output to the browser... Do you have the HEAD reply? Can you post your php_info()? (Pref on some off-site pastebin) Did this just happen out of the blue after a save, or did you change the environment, etc? – colinross May 24 '11 at 08:17
  • @Colinross, what do you mean with "HEAD reply"? PHP INFO: http://pastebin.com/n31uZhVg – ChrisH May 24 '11 at 08:21
  • @SiteSafeNL: I think @Colinross wanted to know wether you recieved the HTTP header from the webserver. – jwueller May 24 '11 at 08:40
  • @elusive, ah allright! @Colinross, if that whas indead the question, yes, i do receive the HTTP header. Code 200, wich is normal.. – ChrisH May 24 '11 at 08:45

2 Answers2

2

You should be able to set the error log in your php.ini. Everything should be properly listed there. We use that approach for some of our sites, since we do not want customers to be able to see error messages on production servers.

jwueller
  • 30,582
  • 4
  • 66
  • 70
  • The weird thing is, the error log isn't showing anything! The access log shows a request, status code 200.. – ChrisH May 24 '11 at 08:11
  • @Ericson578, just tested it by loading a not existing class, that one does show up in the error log, and on the screen.. – ChrisH May 24 '11 at 08:16
  • @SiteSafeNL: It looks like we're dealing with a logical error, then. – jwueller May 24 '11 at 08:38
  • 1
    @SiteSafeNL: Logical errors cannot be recognized by a machine (at least until we have a very good A.I.). That is the very nature of logical errors. Your code is syntactically and semantically correct. Your program just does not do what you think it does. Do you use output buffering? – jwueller May 24 '11 at 08:49
  • Comes to mind that i'm using Dwoo, a PHP template handler. I'm guessing they are using output buffering.. What can i do about it? – ChrisH May 24 '11 at 08:56
  • @SiteSafeNL: You need to track down where your data goes. Step by step. I cannot help you much with that. – jwueller May 24 '11 at 09:14
0

try logging what key variables are in several of the classes. Worst case scenario, throw in some echo statements here and there just to stay sane.

 error_log(print_r($var, true));
Anony372
  • 494
  • 2
  • 15