Avatar of Member_2_6492660_1
Member_2_6492660_1
Flag 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
PHPWeb ServersMicrosoft IIS Web Server

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
SOLUTION
Gary

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
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?
Gary

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.
Dave Baldwin

You may also want to download and install FastCGI for IIS6.  http://www.iis.net/downloads/microsoft/fastcgi-for-iis
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Member_2_6492660_1

ASKER
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?
Gary

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.
Member_2_6492660_1

ASKER
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?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Gary

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
Member_2_6492660_1

ASKER
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>
Gary

What was the result of the other checks?

Have to go to bed, will come back to it tomorrow
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Dave Baldwin

What do you get if you go to http://localhost/ in your browser?
Member_2_6492660_1

ASKER
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
Member_2_6492660_1

ASKER
Dave

I tested this

http://localhost/default.htm    that works

http://localhost/test.asp         that works

http://localhost/phpinfo.php      404 error
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Dave Baldwin

Run "C:\Program Files\PHP\php-cgi.exe" C:\inetpub\wwwroot\phpinfo.php
Member_2_6492660_1

ASKER
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 %
Dave Baldwin

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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Dave Baldwin

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).
IIS Application Configuration
Member_2_6492660_1

ASKER
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
Member_2_6492660_1

ASKER
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?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Dave Baldwin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Member_2_6492660_1

ASKER
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.
Dave Baldwin

You're welcome, glad to help.