HOW TO MAKE PHP WORK ON IIS 6

I am  working on Windows 2003 Enterprise Edition R2

Just installed IIS 6 and PHP 5.2.5.

I see:

a). Under control panel->adnininstrative tools an entry for IIS which works fine if clicked

b).I also see a folder c:/Inetpub->wwwroot->aspnet_client->system_web->1_1_4322  and files named SmartNav.htm,SmartNav.js,WebUIValidation.js

now i edited the SmartNav.htm file and whatever I wrote in that file shows up when I try to access the IIS through localhost through URL: http://localhost/aspnet_client/system_web/1_1_4322/SmartNav.htm   and it works fine. Does that mean PHP and IIS 6 are working together without  a glitch?
I write some PHP code and IIS fails to run it or even recognoz a file exists. are there any good resources on PHP/IIS 6 on Windows 2003 Server R2?

Thanks
perfect_tranquilityAsked:
Who is Participating?
 
hieloConnect With a Mentor Commented:
On day 1 I posted a link to a step-by-step video tutorial on how to install php on IIS6. It specifically tells you "loud and clear" to "use the zip package. The MSI installer messes up too often". I suspect you did NOT follow the tutorial step-by-step. Had you done so you would have had this finished since day one.
0
 
top_rungCommented:
Very generally, and a very rudimentary test would be to create  a PHP info file by inputting the following in a text editor...

<?
phpinfo();
?>

Save it as testing.php (or whatever name you want with a PHP extension) and place it here...

Drive:\INETPUB\WWWROOT     (where "drive" is your working source)


Open a browser window and enter http://localhost/testing.php  (or whatever you saved it as)

If you see a PHP information page, things appear to be working.  If however you see source code, then it isn't properly configured.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
RubalJCommented:
Please find this detailed information on howto install PHP 5 with IIS 6.0

http://www.peterguy.com/php/install_IIS6.html

I hope it helps ..

0
 
perfect_tranquilityAuthor Commented:
ok, gimme 10 min, i will right here,talking to IRS
0
 
top_rungCommented:
"talking to IRS"

Ugh, sorry to hear that.  ;)
0
 
perfect_tranquilityAuthor Commented:
I am on it ,doing things, you guys have advised...will be back fater gettting some results
Thanks
0
 
perfect_tranquilityAuthor Commented:
spoke to IRS coz just out of the blue I got to know I can take credit for my student loan in India, million rupees that was.... will be going to talkm face to face with a rep of AARP soon
0
 
perfect_tranquilityAuthor Commented:
3 experts have responsed. I think I did the exact same as the guy on video tutorial. All files in c:\Inetpub\wwwroot are working and can be accessed by IIS by going to http://localhost/1.txt  ,http://localhost/1.htm etc but a file like index.php with a simple code like
<?
phpinfo();
?>

wont be recognixed by IIS, saying "The page can not be found"

as regards expert#2 I am working on it right now.....

Thanks

0
 
hieloCommented:
>>"The page can not be found"
implies that the URL you typed does not "map" to a file on the server. Make sure you are typing the correct path to the file on the url and that you spelled it correctly.
0
 
perfect_tranquilityAuthor Commented:
sorry that video dint work for me, am I welcome to further discuss that case?
0
 
perfect_tranquilityAuthor Commented:
top rung: not working!

main issue is not to see if it working or not but to see if not, how do i set it up? i am trying as i type here
0
 
RubalJCommented:
Do you have PHP mapping setup on the site and its web extention added on IIS and enabled?
0
 
top_rungCommented:
Well, if the info.php file doesn't come up, it is not working.  Sorry if I am misunderstanding your question.

Here is what appears to be a complete walk through on setting up both IIS and PHP.  Looking them over, they seem short and to the point.  Please verify that you have taken the steps necessary....

http://aszelag.spaces.live.com/blog/cns!7FD523D714963B13!321.entry
0
 
Firmin FrederickSenior IT ConsultantCommented:
is this a pre-requisite for php to work on IIS? and if so should it be pointing to the folder where my php pages are being loaded from and not the location of IIS default website?

doc_root="C:\Inetpub\wwwroot"
0
 
top_rungCommented:
Shield1,

I believe IIS has a problem when you set the doc_root to a folder outside of the default. - don't quote me on that.  If you leave it blank, and don't put a path, it should still work.    Give it a shot, please post back.  I don't currently have an IIS 6 implementation that is not in production for me to play around with it, but I would like to you know.  In IIS 5 on a workstation, all I have access to is the default site, so that doesn't help me any to test it.







0
 
perfect_tranquilityAuthor Commented:
ok, i have spent hours trying something that never seems to work, one person on web claims that his code issue was the "real issue" behind what crap php is and another does the same!

I am sill there,have not accomplished anything. all files in c:\Inetpub\wwwroot are working fine by going to http://localhost/filename except for any php file. if i try that it gives 404  and if i go to the folder and click on run directly it outputs the php code itself, dsnt run it.

Thanks
0
 
perfect_tranquilityAuthor Commented:
also under the Home Directory tab of Web Sites properties the Create button under Application Settings" is disabled and so is the Application Pool buttton. Have no idea if that could be a problem
0
 
perfect_tranquilityAuthor Commented:
is there any good tutorial ? i have been told to install PHP on IIS 6 running under Windows 2003 R2 and Oracle in background
0
 
perfect_tranquilityAuthor Commented:
top rung: when you say it is not properly configured what is "it" ? php alone? IIS alone? or the combo of php and IIS?
0
 
top_rungCommented:
Perfect_Tranquility,

It can be either.  My guess is IIS is not properly configured.  Can you verify that you properly added the isapi.dll and enabled your web extensions?  

For ISAPI, (per the link above)...

to add the PHP5 ISAPI extension to Internet Information Services 6.0 (IIS 6.0) on Windows Server 2003 Enterprise Edition SP2. Open up the IIS 6.0 manager:

Go to Start -> Administrative Tools -> Internet Information Services (IIS) Manager.
Select Server_name -> Web Service Extension.
From the right pane, click Add a new Web service extension... option.
In the Extension name field enter PHP5 ISAPI.
Click the Add button.
Click the Browse button.
Browse to the C:\PHP5\php5isapi.dll file.
Click the Open and OK button.
Check the Set extension status to Allowed checkbox.
Click the OK button.
-----

Now, if you have done that, make sure you added it to the extensions and allowed it like so ...
For the web extensions, r-click on Web Service Extensions (on the left hand side  when in IIS) and choose 'Add a new web service extension'.
Enter in php and click add.
Next, browse to C:\php\php5isapi.dll.  Make sure you set the extension status to allow.

Finally, make sure your website has index.php as a default document to use.

Have you accurately completed these steps?
0
 
top_rungCommented:
Sorry, that was a double posted recommendation.  I pasted the links steps and added my own steps. Either way, Same thing. -:-\
0
 
perfect_tranquilityAuthor Commented:
i have a php.ini file that was there when i installed from the msi. i added the php5isapi.dll file as extension allowed. my test file is test.php.   all it says is 404 error while it can still look up the text,jpg files easily.
0
 
perfect_tranquilityAuthor Commented:
i need   fast comments as i am working on that very server in company right now
0
 
top_rungCommented:
The fastest thing for you to do it to print this out and follow it accurately...

Since you used the windows installer, I would uninstall it, and as posted in this article, use the ZIP files located here....

http://www.peterguy.com/php/install_IIS6.html


If you do as the article states, you should be up and running.
0
 
RubalJCommented:
^^ same article was suggested by me on this thread on 28 Jan.. I really hope it helps..
0
 
top_rungCommented:
Sorry, my mistake RubalJ.  

That is a great article and credit should be given appropriately.
0
 
top_rungCommented:
So it is clear, don't use the windows installer.   Install the ZIP distrib titled...

Windows Binaries
PHP 5.2.5 zip package [9,713Kb] - 08 November 2007


found here....http://www.php.net/downloads.php

(this info is included at the beginning of the article metioned by RubalJ and myself)

0
 
perfect_tranquilityAuthor Commented:
my friend used goto meeting and he went to php.net and clicked on the msi link and as soon as the URL changed for the 5.2.5 version he changed it to 5.2.0 and somehow made it working from another state on my laptop. so it apears msi is not to be blamed.its just individual preferences and hits and trials and of course knowledge of how to tweak things.will get back in some hours now. thanks so much :-)  btw i need to get it working at my office
0
 
ajollyCommented:
in IIS, right click on your virtual directory.
select 'properties'.

and then there you wil see the 'configuration' button.
click and add .php extension there and browse the php-cgi file in your php folder and say ok.

I think it should work fine.
you don't need some very special settings.
0
 
perfect_tranquilityAuthor Commented:
hielo: i could have given full marks right where you posted the link, but what you have written  here makes more sense. your confidence that you were right has a big hand in awarding this max points.......

thanks to others too who tried their best....dont worry iwill have more questions on php ..this time php and oracle and installing a package which has an exe in it. so watch out. again thanks!!!!

R
0
 
Firmin FrederickSenior IT ConsultantCommented:
message for top rung: I've left doc_root blank, in any event when you run phpinfo it accurately shows the location where my website files and xx.php files are being loaded from.  

my xx.php files work a treat except that when I get errors on formmail.php it sends clients to "bad_url" so I've just changed the content of bad_url and all is good.

NB for all users: if you're following PHP install how to's then yes please use the .zip files because the installer changes permissions and other settings on the "default website" that means you will have to reload  
OWA/Exchange/OMA virtual folders etc.

if the PHPINFO script brings up a working page but you still have php page problems check your php script.
0
All Courses

From novice to tech pro — start learning today.