Helpful Information
 
 
Category: IIS
PHP-IIS Problem

Hi,

i have just installed PHP and IIS on a server on the company network, to work alongside MySQL for an Intranet, i have created some test PHP web pages and saved them in the C:\Inetpub\wwwroot folder and when i try to open them up in Internet Explorer the page comes up as error 404 unable to view page, or error 500 Internal server error. I have followed instructions on how to setup IIS however, the instructions are very brief, is there a more detail guide available, or could anyone help me with this problem.


many thanks

Did you verify that IIS was working right before installing PHP?

I haven't run PHP on a windows server but it is pretty common. Make sure you are an administrator user when you install IIS and PHP is one tip.

I imagine you have viewed this page already.

http://www.php.net/manual/en/install.windows.php

I followed instructions on how to install PHP from a book called PHP and MySQL Web Development, By Luke Welling and Laura Thompson. It shows how to connect PHP with IIS, and view a test php page, however, this is only brief description, and does not explain what to do if this does not work. please help!!!

Did you look at the link I posted above?

hi,

yeah ive looked at the link provided, i am using windows 2003 server, i am able to view static web pages through IIS. however, when i try to view a php page i comes up with a 'cannot find page' error. i then decided to re-install php using the php installer, and i came up with a missing OCX control on your system error message whichsays that the installation wizard was unable to configure your web server, although php was installed successfully. therefore, i am unsure whether it is a php problem, or as the security settings on windows 2003 are different to 2000, in the fact that settings need to be enabled as they are locked down in order for programs to work. has anybody encountered this problem before?

Try http://www.php.net/manual/en/install.iis.php and look at the fourth user comment. I believe that's what you need. It works for me.

Also use the zip release. For some reason the installer doesn't work on 2003. For me at least.

I'm in the same situation but I would like to run PHP as CGI instead of as an ISAPI module. I'd appreciate any help/links/ideas on how to set this up?

TIA

My .02: Enabling CGI on an IIS server presents numerous security issues, which is why I believe PHP was released as the ISAPI mod for IIS/WinServers.

The OCX error is due to the automation of the php script mapping (what IIS looks to in order to make PHP work) failing. You have to manually tell IIS how to use PHP.

Doug G said it best: http://www.php.net/manual/en/install.windows.php

My .02: Enabling CGI on an IIS server presents numerous security issues...
I was under the impression that the isapi mod was a security risk. maybe I got it the other way round.


I'm still interested though in setting it up as CGI.

This link looks helpful

http://urbanware.netfirms.com/python/pythonIIS.html

It's a bit late now so I'll try that method later. But it does look promising.

So while I'm here, thanks for the link Doug G :D

thanks for your help, ive got it sorted now, really appreciate it.

cheers

Hi wivellJ,
I'm having the same problem with PHP + ISS install. I'm getting a 404 error on every page I test. I've already tried several install guides on the net. None of them seems to work for me. I must be missing something. In you last pst you said you have resolved this issue. Can you explain what you did to resolve it? Thanks.

Apparently this is a common problem, because I came here looking for help on the same issue. Our system admin is trying to setup a new server for our website and whenever we try to bring up any page with a .php extension we just get a generic 404 error.

I think from reading the posts above I'll give my admin the info about adding PHP as a web service extension that I found on http://www.php.net/manual/en/install.iis.php. A person on there said this was a new step in IIS6, so the admin probably doesn' t know about it.

I have resolved the issue. Yes it is a very common problem. The problem isnt with PHP or the PHP install instructions posted on the net. It's with the default security settings on IIS 6.0 on Windows 2003. The default settings prohibit IIS from running DYNAMIC Content( ASP, CGI, PHP, etc... ). IIS. Enabling Dynamic Content on IIS 6.0 on Win 2003 is described in the 'Support and Help' system. Open Start->'Support and Help'->'Internet and Email Services'->'Internet Information Services (IIS) 6.0 security overview'

Here is what the help files say:


IIS 6.0 is fully locked down by default
When you install IIS, the service is installed in a highly secure and locked mode. By default, IIS serves only static content, which means that features such as Active Server Pages (ASP), ASP.NET, Indexing Service, server-side includes (SSI), Web Distributed Authoring and Versioning (WebDAV), and FrontPage Server Extensions do not work unless you enable them. If you do not enable these features after installing IIS, IIS returns a 404 error. To serve dynamic content and unlock these features, you must enable them by using IIS Manager. Administrators can enable or disable IIS functionality based on the needs of the organization. For more information, see "Enabling or Disabling Dynamic Content" in IIS 6.0 Help. Also, if an application extension is not mapped in IIS, IIS returns a 404 error. To map an application extension, see "Setting Application Mappings" in IIS 6.0 Help. For more information about troubleshooting 404 errors, see "Troubleshooting" in IIS 6.0 Help. For information about how to open IIS 6.0 Help, see To view Internet Information Services (IIS) 6.0 Help.



The help files show you how to enable Dynamic Content.
Also make sure your PHP.ini doc_root = "yourrootpath" parameter is set correctly. This should be the root of all your .PHP files.

Let me know if it works for you. Thanks!

I noticed one thing that is not mentioned in this posting. It is that you would need to add the web service extension. This would allow your php to work while IIS is in lockdown... Just do the simliar procedure on this as you did with ISAPI Filter and ISAPI Extension, like ".php", ".inc", ".asp", etc...

Just doing the web service extension solve the problem for me...

FletchSOD

Hello

I am having the same problem, and I have added PHP in the web service extension, but unless I allow all unknown CGI extensions my PHP scripts will not work. I understand that this would be a bad thing? I think I am missing something small. Would anyone be able to point out my oversight.

Thanks
George

I've had the same problem and finally the solution turned out to be a simple addition of php extention to the Web Service Extensions in IIS and relate it to php.exe
I hope this helps
g










privacy (GDPR)