Click to See Complete Forum and Search --> : 404 page on PHP4, IIS5, WIN2K ?
Hi!
I am using PHP4 on a WIN2K, IIS5 computer, no problems.
However, if I try to access a non-existent URL (.../nosuchfile.php), instead of getting a 404 error page, I always get a "CGI application misbehaved...." error message.
How can I get PHP4 to return the proper 404 messages instead of a CGI error in such cases?
Many thanks,
Steve
starfish
12-16-2001, 09:12 PM
For IIS5 to work with PHP try the following
1. Go to adminstrative tools
2. Go to Internet Information Services
3. Go to your main site where you want PHP installed.
4. Right click on it and select properties from the drop down box (i.e. Default Website)
5. go to the home directory tab
6. Look for application settings and then click on the configuration button on the right hand side.
7. click on app mapping tab and look for a button called 'ADD'
8. A box will pop up - Click on the browse button and look for the PHP.EXE file, located on your HD.
9. Enter into the box marked extension : *.PHP
10. Now tick the box marked scripting engine
11. Click on OK
12. Click on OK
13. Click on OK
14. you should be back at the start.
15. Now test your pages.
I don't know if this works with the ISAPI version of PHP, but you can give it a go.
Hi!
Thanks for such a speedy reply!
However, I think my question was not quite clear enough, my apologies for that!
PHP pages ARE working on IIS5, the only problem I am having is that if I reference a non-existent PHP script I get a CGI error instead of a regular 404 error page. Other than this, all seems OK.
BTW: The ISAPI version works under IIS5, but is very unstable, after about every 10 page hits it jsut gives up and IIS must be restarted for it to work again. However, the EXE works just fine! :)
Thanks again!
Steve
starfish
12-16-2001, 09:27 PM
I just checked this and found the same problem as yourself, I corrected it by doing the following :
1. When you get to the add part, do the following :
Use the DLL (PHP4ISAPI.DLL) as the executable
Use 'PHP' as the extention.
In the verbs section select 'LIMIT TO' and in the box enter the following : GET,HEAD,POST,TRACE
Check the box 'Script Engine'
Check the box 'Check File Exists'
This should correct the problem.
Hi again! :)
Thanks! :)
It seems to be O.K. now, as far as the 404 page is concerned.
However: Do U think the instability problem related to the DLL instead of the EXE I also mentioned is thus solved? So far it seems O.K., and, as mentioned in the PHP install docs too, it seems fasster than the EXE (or it's just my imagination? :) ).
Thanks again,
Steve
starfish
12-16-2001, 09:43 PM
No the DLL should be faster, as stated in all the docs. You can use PHP.EXE, if your worried about it, it should give the same results as the DLL. I have tested the .EXE with the same method.
Hi!
Hm, I just realised that PHP 4.1.0 is out, and in the docs it says in this new release the DLL is stable - so I decided to download and try. :) I am sure this way it will be fast and stable, aaaand display the 404 errors. :)
It was a real pleasure "using" this forum, I did not expect to get such fast responses! Manymanymany thanks, and happy Christmas to You! :)
The very best to everyone from snowy Budapest,
Steve :)
starfish
12-16-2001, 10:02 PM
You're welcome, Yep 4.1.0 seems pretty stable and is working fine on my IIS config. At least you'll see your 404 errors now, with the proper responces.
Best regards from non-snowy England.
PHP Builder
Copyright Internet.com Inc. All Rights Reserved.