Link to home
Start Free TrialLog in
Avatar of Member_2_6492660_1
Member_2_6492660_1Flag for United States of America

asked on

How to Install PHP on Windows 2003 IIS6 Web Server

I have Windows 2003 Server running IIS 6. with ASP and HTML pages.
I would like to start using PHP
Where can I found good instructions for this?

Also I have found many documents on the Web  about this but you know how that is.

One more thing where is the link for the download of PHP?  I have found .tar and .GZ files not running Linux here.

Any links and information on how to get started sample php.ini file would all be very helpful

Thanks
SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_6492660_1

ASKER

Gary

Thanks for the links very helpful

Installed now on my IIS 6 server

Do you have a sample php code that I can test to make sure my install is good?
Create a page in your root folder called phpinfo.php and add this code

<?php
phpinfo();
?>

Open in new window

Load the file in your browser through localhost and you should get a list of all the php environment variables etc.
You may also want to download and install FastCGI for IIS6.  http://www.iis.net/downloads/microsoft/fastcgi-for-iis
Dave / Gary

Thanks
I believe that got installed from the link above that Gary provided

When I try http://localhost/phpinfo.php

I get Http Error 404 file can not be found

Any ideas? Do I need to restart IIS after installing PHP?
Yes to restart
Are you sure the file is in the root folder?

FastCGI is not installed by default (unless the PHP installer has changed) but there is link on the same page for installing it.
Gary

I tried to install FastCGI after I installed PHP and it was already installed I believe.

How can I check to make sure it is installed?

Yes the file is in wwwroot folder   c:\inetpub\wwwroot\phpinfo.php

From explorer looking at c:\intepub\wwwroot\[hpinfo.php  it does not have a file association.

Do I need to add .php to the mime configuration of IIS?
Everything should be set up ready to go with the WI

Can you go through the troubleshooting steps here
http://blogs.iis.net/donraman/archive/2009/11/15/troubleshooting-php-installation-on-windows.aspx
Gary

Thanks for the link

First two commands failed

C:\WINDOWS\system32\inetsrv>cscript.exe c:\inetpub\adminscripts\adsutil.vbs get w3svc /default.doc
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

CScript Error: Loading script "c:\inetpub\adminscripts\adsutil.vbs" failed (Access is denied. ).

C:\WINDOWS\system32\inetsrv>cscript.exe c:\inetpub\adminscripts\adsutil.vbs get w3svc/scriptmaps | findstr php

C:\WINDOWS\system32\inetsrv>
What was the result of the other checks?

Have to go to bed, will come back to it tomorrow
What do you get if you go to http://localhost/ in your browser?
Gary

Have a god night

Found the three files
fcgiext.dll
fcgiext.ini
fcgiconfig.js

I attached the fcgiext.ini file

I ran these two commands

"C:\Program Files\PHP\php-cgi.exe" -v

"C:\Program Files\PHP\php-cgi.exe" C:\inetpub\wwwroot\test.php


C:\>"c:\program files\php\v5.3\php-cgi.exe" -v
PHP 5.3.28 (cgi-fcgi) (built: Dec 10 2013 22:06:16)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies


That's it so far
fcgiext.ini
Dave

I tested this

http://localhost/default.htm    that works

http://localhost/test.asp         that works

http://localhost/phpinfo.php      404 error
Run "C:\Program Files\PHP\php-cgi.exe" C:\inetpub\wwwroot\phpinfo.php
Dave

I ran C:\Program Files\PHP\php-cgi.exe" C:\inetpub\wwwroot\phpinfo.php

But it produces so much output I could not copy and paste it into notepad

I tried C:\Program Files\PHP\php-cgi.exe" C:\inetpub\wwwroot\phpinfo.php  >c:\test.txt

got access denied.

I paused the output several times  did not see any errors put not 100 %
You generally don't have access to the root on C:\.   Just use
C:\Program Files\PHP\php-cgi.exe" C:\inetpub\wwwroot\phpinfo.php  > test.txt

The most important thing is that it ran.
In your IIS configuration, you should see this 'Application Configuration' that shows '.php' and 'C:\Program Files\PHP\php-cgi.exe' ( my PHP is in a different location).
User generated image
Dave

I redirected to another local drive that worked

Attached is the output looked ok to me.

So it is working why am I getting 4040 on php?  Permissions issue?
test.txt
Dave

Thanks for the screen shot

I was missing the mapping setting for php

Added that entry  still 404

I even restarted IIS no luck

Any thoughts?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dave /Gary

Got it working now

Had Cache ISAPI extensions was checked at the top level of my Web Sites
After unchecking the cache option it started working

Thanks for all your help.
You're welcome, glad to help.