404 Error Pages Don't Work for Me |
[eluser]Burak Erdem[/eluser]
Hi, I was working with ZendFramework before and decided to use CodeIgniter for my new project. I just started to develop a new application with CI. Everything is working great except those 404 error pages. When I try to load a page that doesn't exist (like http://localhost/user/abcd which "abcd" doesn't exist), Google Chrome endlessly tries to load that page, and Firefox tells me that this page doesn't exists. But no sign of CI's own 404 error page. I have the controller but not the correct action in it, so I expect to see an error page. I also tested this with a brand new CI installation. I'm on a Windows Vista machine, on my localhost and using Zend Server CE with Apache 2.2, MySQL 5.0 and PHP 5.2.9 installed. My .htaccess file is like below; Code: <IfModule mod_rewrite.c>
[eluser]Cro_Crx[/eluser]
Just out of interest if you browse to http://localhost/user/index.php/abcd "in which abcd doesn't exist". Do you get an error message then?
[eluser]Burak Erdem[/eluser]
@Cro_Crx It doesn't show any error page in Google Chrome because Chrome never stops loading the page. Firefox gives the standard "File Not Found" error. Let me explain this a bit more. I have a controller named "user" and a "details" function in this controller. When I browse to http://localhost/public/user/details my browser successfully displays the page. But when I try to browse like http://localhost/public/user/login (which "login" function doesn't exist) Google Chrome never stops loading, and Firefox gives the above error. Btw I've changed the directory structure a little bit. But I think directory structure has no effect on this because when I try this with the standard CI installation, this situation doesn't change. This is what my directory structure looks like. [Image: http://img18.imageshack.us/img18/1487/74675804.th.png] Here is my /public/.htaccess file Code: <IfModule mod_rewrite.c> And my /public/index.php file (removed comments, edited $system_folder and $application_folder) Code: <?php
[eluser]Burak Erdem[/eluser]
I'm still having this 404 issue. But I just realized that show_404() is also not working for me. Google Chrome still endlessly loops and Firefox shows default error page. Please tell me something to solve this 404 issue. Thanks..
[eluser]devbro[/eluser]
[quote author="demods" date="1249872067"]I'm still having this 404 issue. But I just realized that show_404() is also not working for me. Google Chrome still endlessly loops and Firefox shows default error page. Please tell me something to solve this 404 issue. Thanks..[/quote] Just for testing. create a simple page that return 404 using simple php (no CI) and see what happens. There is a chance that what you are describing is something built into the ff and chrome. browsers may act differently under diff conditions. for example I wanted to view an rss-xml but no matter what you do ff won't let you do it easily.
[eluser]Burak Erdem[/eluser]
OK, now I see there is a problem. I just did what you said, devbro. I used the following code to generate a native PHP error; Code: <?php It's still the same. Endless loop in Google Chrome and default error page in Firefox. Well, I don't understand what the problem is and I don't know what to do now ![]() I'm on a Windows Vista machine and I use Zend Server CE to develop my application. Is there an option in php.ini or httpd.conf that prevent to produce errors?
[eluser]devbro[/eluser]
[quote author="demods" date="1249873078"]OK, now I see there is a problem. I just did what you said, devbro. I used the following code to generate a native PHP error; Code: <?php It's still the same. Endless loop in Google Chrome and default error page in Firefox. Well, I don't understand what the problem is and I don't know what to do now ![]() I'm on a Windows Vista machine and I use Zend Server CE to develop my application. Is there an option in php.ini or httpd.conf that prevent to produce errors?[/quote] oki then here is the dirty quick, work around for you: remove the first line from system/application/errors/error_404.php that should aleast show the error page for now.
[eluser]Burak Erdem[/eluser]
devbro you're the man ![]() Now it's time solve the real problem. I know that's not related with CI anymore, but how could this be and what do I have to do to solve my PHP error issue?
[eluser]devbro[/eluser]
[quote author="demods" date="1249873748"]devbro you're the man ![]() Now it's time solve the real problem. I know that's not related with CI anymore, but how could this be and what do I have to do to solve my PHP error issue?[/quote] I don't think it is a php problem. i would further try to create 404 by other means such as .htaccess . if the problem persist then I suggest to submit a ticket to both ff and chrome developement teams. If i am wrong and it is indeed a php problem then taking a look at the actual response from the server should give some light to what is happening. maybe telneting to the server on port 80 and typing : GET http://www.devbro.com/asdasdasdas
[eluser]Unknown[/eluser]
Hello, I had same problem and I found solution for this. ![]() Problem is with PHP loader. php-cgi - not working correctly for me (I had Zend Server CE) php5apache2_2.dll - ALL working fine. LiborM |
Welcome Guest, Not a member yet? Register Sign In |