Error 404 instead of a php error message

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mahmood
Forum Newbie
Posts: 8
Joined: Fri Mar 19, 2004 5:23 pm

Error 404 instead of a php error message

Post by mahmood »

Hi

Recently I got error 404 "page not found" instead of a php error messages. setting error_reporting to different options wouldn't help as well.

Why is this?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You need to give a little more information. First of all, the page you are loading, does it exist on the server? Is it named exactly the way you are calling it? Did it work before? Answer some of these questions and let's see if we can help you.
mahmood
Forum Newbie
Posts: 8
Joined: Fri Mar 19, 2004 5:23 pm

Post by mahmood »

[quote="Everah"]You need to give a little more information. First of all, the page you are loading, does it exist on the server? Is it named exactly the way you are calling it? Did it work before? Answer some of these questions and let's see if we can help you.[/quote]
Does this mean that it is impossible?

I am certain that it happens. for example if I have $result5 = mysql_query($sql5) OR die(mysql_error()); and there is no connection to the database, then I get page 404 error instead of relative error message.

Or another example that I just saw, I renamed $result5 to $result but I didn't rename it here: $name = mysql_result($result5,0,"Name"); and I again I got error 404, I correct it and everything is OK.

Again anothe example I delete a line but "$" remaind, the same error. Something like this: $name = stripslashes($name);, I deleted the line except "$".
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Check the name of the file and make sure you are using the right case. 404 errors are thrown by the server because it cannot the file named by the URL reference. Apache is a case sensitive server, so a file name myFile.php is not the same file as myfile.php. If you are still getting the 404 page after changing your page code it is because the file cannot be found, not because of the code on the page.
Post Reply