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?
Error 404 instead of a php error message
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
[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 "$".
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 "$".
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
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.