PDA

View Full Version : Dear Abby



JayT
09-18-2007, 11:05 PM
DEAR ABBY, you old goat:


Ever since I installed PHP 5 on my local PC web server, I can't get errors to show up as I write programs.

When I test a page, I get a server error 500 - instead of the error and line number.



The website cannot display the page

HTTP 500

Most likely causes:
The website is under maintenance.
The website has a programming error.

What you can try:
Re***** the page.

Go back to the previous page.

More information

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.


When I was using PHP4, the error and the line number would be displayed. Now it's next to impossible to find the line where it failed since it doesn't display it any more.

Grrrrrrrrrrrr

I have always suspected that there was a massive, underground, intergalactic PHP conspiracy run by space aliens to drive me mad - and now I see it's all true!

I can't seem to find whatever "php.ini" settings will solve this problem. As far as I know, it's set to display ALL errors. But that's not what happens.

PHP 4 showed me exactly where the program failed - not anymore!

Any ideas ?




Frustrated in YadaYadaLand
I want my mommy!

Moonbat
09-18-2007, 11:14 PM
Maybe it's just your host?

Try a differnt host to see if you get the same problems.

JayT
09-18-2007, 11:22 PM
Maybe it's just your host?

Try a differnt host to see if you get the same problems.

It's not the host. It's my web server at home on my PC.

I write my programs there and then once tested to be working correctly, I then put them on my Internet web site.

I was using PHP 4 before. When I made a program error, the error and line number would be displayed to the screen, which made it quicker to debug.

I upgraded to PHP 5. Now it doesn't do that any more. Just displays a bland server 500 error with no other info.

I use error logging, but it would be much more convenient to see the errors on screen the way PHP 4 did it before.

Probably a "php.ini" setting, but if so, I can't find it.



Where's my rum?

Ezekiel
09-19-2007, 03:05 AM
If it gives that generic error message on all pages, it's probably a server problem (PHP not configured correctly, or something).

If it only shows that page when there is an error in your code, try turning error displaying on in php.ini:

http://www.php.net/manual/en/ini.php

Search the page for "error".

JayT
09-23-2007, 07:33 PM
If it gives that generic error message on all pages, it's probably a server problem (PHP not configured correctly, or something).

If it only shows that page when there is an error in your code, try turning error displaying on in php.ini:

http://www.php.net/manual/en/ini.php

Search the page for "error".


I was able to activate error logging.

The errors in the log are the same errors that used to display on the screen, but my INI settings don't seem to make it work that way anymore.

But error logging is OK, since I can keep it displayed in one window while editing and running the program in another. I just need to immediately know exactly what and where the error is to be able to fix it.

Otherwise, even a missing ; or any other simple syntax error causes a server 500 error in every case.