Forum Moderators: coopster

Message Too Old, No Replies

Perplexing PHP error - insight needed

         

gnetcon

7:40 pm on Dec 8, 2008 (gmt 0)

10+ Year Member



Hello, all!

I have taken over a code base, and I having the hardest time trying to get the resulting web pages to display. I'm updating the code to run in PHP5, meaning adding some db stuff, updating some 3rd party classes, etc.

The problem I'm having is that when I load the page in Firefox, I just get a white screen, which normally means there's a PHP error somewhere. So I started going through them, and fixing as needed.

Now, the error_log doesn't display any errors when I load the page, but I still get a white screen.

Where should I look now? I see the access log is logging the hit, and if I simply do a phpinfo() call and immediately exit, the page appears fine, so that seems to me PHP is working nicely with Apache.

Any guidance would be appreciated.

coopster

8:09 pm on Dec 8, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Double check your error directives in php.ini to make sure you have the error_reporting set as desired and that your error log is set appropriately. Don't forget to restart Apache (assuming PHP is running as an Apache module).

gnetcon

8:19 pm on Dec 8, 2008 (gmt 0)

10+ Year Member



I have the following setup (and I did restart the web server - learned that the hard way awhile back):

error_reporting = E_ALL
display_errors = On
log_errors = On
error_log = /var/log/httpd/php_error_log

I restart the server, but I still get the white screen, and no errors displaying on screen or in the log.

coopster

8:22 pm on Dec 8, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Are you using php's auto_prepend directive? I learned awhile back that nothing shows in the logs if you have an error in the prepended file. The parser quietly fails and no response is sent to the browser.

gnetcon

8:32 pm on Dec 8, 2008 (gmt 0)

10+ Year Member



Thanks for the quick feedback coopster.

Nothing there. The directive is simply:

auto_prepend_file =
auto_append_file =

I think I'm making head-way. I renamed a file that should be included, and I actually got a window. I'm thinking something is failing somewhere because a command has an @ in front of it.

If I find the answer, I'll post it here.

coopster

9:08 pm on Dec 8, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



These can be difficult. A long way of working this out is to start with an
exit('You are here');

line that you move around in your code. Start after the first output or include statement to see how far your script progresses before you have issues.

It's a bit of a longer process to troubleshoot this way, but sometimes it's your only resort!

gnetcon

9:14 pm on Dec 8, 2008 (gmt 0)

10+ Year Member



Thanks coopster.

That's pretty much where I'm at. When I throw an error intentionally, it's showing up on the screen and in the log. So it has to be a command somewhere that is set not to display an error.

Still hunting. *SIGH*

janharders

12:50 am on Dec 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mh, are you sure that the blank page isn't just "intentionally left blank"? I had a case once where somebody just didn't care to print anything if the correct parameters were not passed. maybe add some simple print statements (not exit ones throwing an error) and see if they get executed.

Pico_Train

4:45 am on Dec 16, 2008 (gmt 0)

10+ Year Member



IS this page using templates like Savant? Assigning variables to the template and displaying them in a specific template? Is the path to the template correct?

gnetcon

2:10 pm on Dec 16, 2008 (gmt 0)

10+ Year Member



Thanks for all of the feedback!

It was, indeed, a code error. I went through and did a:

print "Loaded!\n"; exit();

and found where the code stopped. It turned out to be a JpGraph problem, using a PHP 4 version when I needed the PHP 5 version.

After I did that, and made some minor changes, all was well again.

Thanks!