Solved

Windows 2003 Server IIS 6.0 PHP Asapi Module

Posted on 2004-03-23
10
2,382 Views
Last Modified: 2012-05-04
I am about to loose my mind!  I have been trying to get PHP working as a module on IIS for about a week now.  Originally I was trying to get PHP5 RC1 working with IIS on Windows 2003 Server.  After following guide after guide, I kept running into the same problem.  I do everthing as listed in and answer to a similar question on this site:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Hi,

I got the latest stable version of PHP running on Windows 2003 IIS6.0, without any problems.

* You first need to add a 'Web Service Extension' in through IIS manager, I called the extension PHP, and added the path to php4isapi.dll (don't forget to set the status to allowed)

* Then go to the properties of the website where you want to run PHP, select the 'Home Directory' tab, and click on the 'Configuration' button. Click 'Add', browse to the 'php4isapi.dll' file (put the path between quotes), type '.php' as the extension, and deselect 'Verify that the file exists'.

* copy the 'php4ts.dll' file from the php directory to the windows\system32 directory, and copy the php.ini-recommended file to the windows directory, and rename it to php.ini

*do a iisreset, and your php should work fine (without putting IIS in isolation mode)

Regards,

Enrico Klein
Vertis BV
Netherlands

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After pulling my hair out for a while, I decided to try it with PHP4 instead of the new 5 version.  After doing that I got the same problems as I has having with 5.  Here is my issue:

After folowing thew above instructions to a TEE, this is what happens.  I add my website and create a basic PHP script called index.php
Script:
XXXXXXXXXXXXX

<?
phpinfo();
?>

XXXXXXXXXXXXX

When I try to access my script via my web browser, I get prompted to enter a username and password.  If I enter a machine username and password (ex.  Administrator, Password) it simply reprompts me to enter the password again.  It saves all the password infomration in the dialog box.  If I re-enter the username and password it continues to reprompt.  After three times it takes me to the no permissions page.  I don't think it is a permissions issue.  When I creat a static HTML file with the same permissions in the same directory it works fine.  If anyone could tell me what I am doing wrong I would really appreciate it.

0
Comment
Question by:justincouto
  • 5
  • 5
10 Comments
 
LVL 2

Accepted Solution

by:
rqs earned 500 total points
ID: 10664334
Try this how-to page for configuring PHP on IIS 6.0
The IIS account may not have the appropriate execute
permissions for the directory on which the PHP page is located. The page
illustrates steps for doing so.

http://s92192454.onlinehome.us/PHP_on_windows_under_IIS.html

you would have to customize php.ini a little
(i.e. if you need session support, make sure the session variables in the
ini file point to the appropriate directories where IIS has write permissions, and so on)

0
 
LVL 2

Expert Comment

by:rqs
ID: 10664398
the site I mentioned on configuring PHP for IIS is the best I found, with nice screenshots.
I'm convinced you missed a configuration somewhere that's why you encounter those password prompts.
I encountered them myself. some how-to sites just don't mention everything and rely that you already now how to
do the rest of the process.

I wish to reword this:
"The IIS account may not have the appropriate execute
permissions for the directory on which the PHP page is located. The page
illustrates steps for doing so."

It's not the IIS account per se, it's the IIS configuration. There are are instances when
you do have to configure folder permissions for the IIS account. For example,
if you need to use sessions for your PHP, php.ini variable session.save_path
must point to a file on your machine where the session info would be saved and for
which IIS has the appropriate write permissions.

0
 
LVL 2

Expert Comment

by:rqs
ID: 10664421
Ok, just got another idea =) ....
open the properties tab for the IIS website for which you want to configure PHP.
make sure that the dropdown list box labeled "Execute permissions" is set to "Scripts and Executables".

If that doesn't work or you already have done that, I recommend following the how to page
I pointed step by step.
0
 

Author Comment

by:justincouto
ID: 10672767
OK,

I have some answers now.  I finally got PHP4 working somewhat.  I was initially trying to install PHP5 RC1 and I was getting the continous prompt for a username and password.  I am still having that problem with PHP5.  In an attempt to get this working now and not 10 years from now, I decided to go to PHP4.  After trying to install that I kept getting 404 errors which are consistent with other people on the web.  Their solution was to add a web service extention.  I did this and it didn't help.  What I finally realized is that the problem was that I was installing PHP into C:\Program files\PHP instead of C:\PHP.  I thought it wouldn't make a difference as long as my config was right.  However this isn't the case.  I guess the compiled version of PHP has to be installed in C:\PHP.  I guess the DLL's have some hard coded links in them or something.

OK, so I got php 4 working and I have my test PHP page working in my doc_root.  However I now need to be able to run php scripts from other directories.

I have a second hard drive E:

I have a directory on this drive called clients.  In this directory I have a directory for each client's site (client1, client2, etc).

I have a website setup pointing to E:\clients\client1.  In this directory I have a test php script.  
I have all the properties on this website the same as my default website that currently works.  However, when I try to acces the php script, the page starts to load and sits there and loads and loads and loads until it eventually times out.  I am now thinking this is a permissions issue.  However, as far as I know, the permissions are the same as they are on the default site.  If you think this is a permissions issue:

What do I need to do to fix it?

What permissions should the directory have?

What permissions should the files have?

Do all the parent directories need to have the same permissions as the directory that the files are in?

If this is not a permissions issue, please inform me of what to do to fix it?
0
 

Author Comment

by:justincouto
ID: 10673043
OK I got it working now.  I was had added some modules in the php.ini that weren't working and this was making the page stall because php wasn't working right.  

I would still like to know why PHP5 won't work.  I would also like to know why you can't install php in C:\Progra~1\PHP

Other then that I am glad I got this working.

Thanks for all the help.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 2

Expert Comment

by:rqs
ID: 10673120
Glad to hear that everythings now working.
Regarding PHP5, I haven't installed that version yet.
I stuck with the last stable I found at the site, which was 4.3.4 (at least during the time I visited).
So I haven't encountered the problem you just described.

I'll see what I can find about this particular problem with PHP5. If this is really a bug then I believe we should
report it to php.org to have it fixed.

Regards
0
 

Author Comment

by:justincouto
ID: 10673129
I am now having touble getting some of the modules working.  When I uncomment the curl module, it kills my PHP.  If that module is uncommented, and I go to a PHP page, it just loads forever until it times out.  Any ideas?
0
 

Author Comment

by:justincouto
ID: 10673139
I am able to load some modules like the PDF module, the GD module, and the zip module.  However, if I try to load Curl or the XSLT module, i get the contious load problem.
0
 

Author Comment

by:justincouto
ID: 10673268
I got it working.  I found this link:

http://curl.haxx.se/libcurl/php/iis.html

All I needed to do to get the curl module working was copy the following files from the C:\php\dlls to the C:\Windows\system32

libeay32.dll
ssleay32.dll
0
 
LVL 2

Expert Comment

by:rqs
ID: 10673451
I'm not sure but maybe this would work:
add the path to c:\php\bin (or wherever your php the dlls are)
to the PATH environment variable so that windows will also look in that directory
when loading dlls.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now