PHP5 with IIS6 on Windows Server 2003 in five easy steps
How to install and configure PHP5 with IIS6 on Windows Server 2003 in five easy steps.
I thought installing PHP would be as easy as just using the install program. Well it wasn't... But by learning from my mistakes it can be almost that easy.
Just follow these five easy steps on how to install and configure PHP 5 on a Windows Server 2003 running IIS - after trying the manual and several guides and tutorials found on the net (of which some were very long and very complicated and some were short and easy but partially incorrect) this is what it all came down to. Enjoy.
This is tested on PHP 5.0.4, IIS6 on Windows Server 2003 SP1. Be aware that IIS is not automatically installed with all editions of Windows Server 2003, this guide assumes that IIS 6 and Windows Server 2003 is already up and running on your server.
1. Download PHP at http://www.php.net/downloads.php. Make sure you dowload the "zip package", the installer package won't work.
2. Extract the downloaded zip file to a directory of choice on your harddrive. The rest of this guide will assume you are using C:\PHP
3. Add C:\PHP to your path. From the Start menu, right click My Computer and select Properties. From the Advanced tab click the Environment Variables button. Under System Variable find Path and click Edit. At the end of what is already present in Variable Value add a semicolon (;) and then C:\PHP.
4. Configure IIS. Open the Internet Information Services (IIS) Manager from Administrative Tools (found directly in the Start menu or in the Control Panel)
a) Web Service Extension. Click down to the Web Service Extension folder. Right click the folder and select Add New Web Service Extension. Set Extension Name to .PHP and add C:\PHP\PHP5ISAPI.DLL to Required Files . Check Set Extension Status To Allowed.
b) Web Sites. Click down to Web Sites. Right click the folder and select Properties. From the Home Directory tab click the Configuration button. Click Add to add an Application Extension. Enter C:\PHP\PHP5ISAPI.DLL as Executable and PHP as Extension. Leave the rest as default and click Ok.
5. All set! To test your PHP installation simply create text a file with the php extension, eg. test.php. Add the following three lines of text to it and then save it to your web site directory, eg. C:\INETPUB\WWWROOT. Then use your browser to read the file, eg. http://localhost/test.php
Other things you might want to consider:
- Some tutorials state that you need to restart the World Wide Web Publishing Service after having installed and configured php. I haven't needed to (ie everything worked fine without restarting the service) but if you do it is found under Services in the Control Panel.
- As you start using PHP, in the not too distant future you will probably need to make some changes to php.ini. PHP works fine without the php.ini file but you really should have one and it should be in your Windows directory. Copy C:\PHP\PHP.INI-RECOMMENDED to C:\WINDOWS\PHP.INI
- If you are going to use MySQL you will need to make sure to uncomment the line "extension=php_mysql.dll" in php.ini and copy C:\PHP\LIBMYSQL.DLL to C:\WINDOWS\SYSTEM32 (Simply setting the PATH won't work as this is apparently hard coded in PHP5). If you don't follow these steps you will get an error message similar to this: "Call to undefined function mysql_connect"
- Read the manual at http://www.php.net/manual/en/install.windows.php
[Updated: If you have any problems, make sure you read the comments to this post. You will find both tips and questions there. If you know the answer to someone's question please answer it.]
(This article is previously published and has been moved to this blog)
I thought installing PHP would be as easy as just using the install program. Well it wasn't... But by learning from my mistakes it can be almost that easy.
Just follow these five easy steps on how to install and configure PHP 5 on a Windows Server 2003 running IIS - after trying the manual and several guides and tutorials found on the net (of which some were very long and very complicated and some were short and easy but partially incorrect) this is what it all came down to. Enjoy.
This is tested on PHP 5.0.4, IIS6 on Windows Server 2003 SP1. Be aware that IIS is not automatically installed with all editions of Windows Server 2003, this guide assumes that IIS 6 and Windows Server 2003 is already up and running on your server.
1. Download PHP at http://www.php.net/downloads.php. Make sure you dowload the "zip package", the installer package won't work.
2. Extract the downloaded zip file to a directory of choice on your harddrive. The rest of this guide will assume you are using C:\PHP
3. Add C:\PHP to your path. From the Start menu, right click My Computer and select Properties. From the Advanced tab click the Environment Variables button. Under System Variable find Path and click Edit. At the end of what is already present in Variable Value add a semicolon (;) and then C:\PHP.
4. Configure IIS. Open the Internet Information Services (IIS) Manager from Administrative Tools (found directly in the Start menu or in the Control Panel)
a) Web Service Extension. Click down to the Web Service Extension folder. Right click the folder and select Add New Web Service Extension. Set Extension Name to .PHP and add C:\PHP\PHP5ISAPI.DLL to Required Files . Check Set Extension Status To Allowed.
b) Web Sites. Click down to Web Sites. Right click the folder and select Properties. From the Home Directory tab click the Configuration button. Click Add to add an Application Extension. Enter C:\PHP\PHP5ISAPI.DLL as Executable and PHP as Extension. Leave the rest as default and click Ok.
5. All set! To test your PHP installation simply create text a file with the php extension, eg. test.php. Add the following three lines of text to it and then save it to your web site directory, eg. C:\INETPUB\WWWROOT. Then use your browser to read the file, eg. http://localhost/test.php
<?php
phpinfo();
?> Other things you might want to consider:
- Some tutorials state that you need to restart the World Wide Web Publishing Service after having installed and configured php. I haven't needed to (ie everything worked fine without restarting the service) but if you do it is found under Services in the Control Panel.
- As you start using PHP, in the not too distant future you will probably need to make some changes to php.ini. PHP works fine without the php.ini file but you really should have one and it should be in your Windows directory. Copy C:\PHP\PHP.INI-RECOMMENDED to C:\WINDOWS\PHP.INI
- If you are going to use MySQL you will need to make sure to uncomment the line "extension=php_mysql.dll" in php.ini and copy C:\PHP\LIBMYSQL.DLL to C:\WINDOWS\SYSTEM32 (Simply setting the PATH won't work as this is apparently hard coded in PHP5). If you don't follow these steps you will get an error message similar to this: "Call to undefined function mysql_connect"
- Read the manual at http://www.php.net/manual/en/install.windows.php
[Updated: If you have any problems, make sure you read the comments to this post. You will find both tips and questions there. If you know the answer to someone's question please answer it.]
(This article is previously published and has been moved to this blog)
Labels: PHP
169 Comments:
Thanks!
Your instructions were really easy to follow and I'm now ready to learn PHP - Sue, Sydney
Man you did a great job! I had an exam
project for school, and I made an webshop in .asp so I could not use XAMMP as a webserver we normaly use that for our websites. But the webserver also needed php support, So I started searching on google and found this blog, it works excelent! double thanks!!
greetings from holland =)
Great tutorial! Everything's working great now.
Thank you.
ummm.. i just want to point out a FLAW in your tutorial...
You forgot to let the users know to un-zip the PHP zip file, in-order to find the "php5isapi.dll" file!!!
haha j/k about the flaw, its not your fault i'm a retard!!!
Thank you so very much for taking the time to type up the tutorial, i tried numerous other tutorials on-line with no luck, yours is truly the simplest and best....
thank you again
Perfecto, a la primera y sin pausa.
Muchas Gracias
Damn..... Your guide looked really cool and I tried to use it for installing PHP on my IIS 6.0 but all I get is a page cannot be found when I try to access my test.php file
Thanks all for your kind and positive feedback!
Re the "page cannot be found" error. From your problem description it's difficult to say why you get this but to me it does not sound like it has to be a problem with the PHP installation but rather that you put the test.php file somewhere else than where you try to access it, e.g. you put it in c:\inetpub\wwwroot\phptest\test.php but try to access it using http://localhost/test.php instead of http://localhost/phptest/test.php
It could also be rights related, check the rights on the file and directory (simply right-click and select Properties on the file and/or directory from Explorer in Windows). Good luck.
"Make sure you dowload the "zip package", the installer package won't work."
Perhaps it would be clearer if it said:
Make sure you download the "zip package" and not the installer package. These instructions are for the zip package. (And besides, the installer package is somewhat limited.)
Hmmm.
Using PHP 5.1.4 and MySQL 5.0 on WinServer 2003 SP1 and IIS6.
Have 2 libmysql.dll files.
One is in the php folder (1.01 MB (1,069,056 bytes); May-4-2006).
The other is in the mySQL bin folder (1.40 MB (1,470,464 bytes); Apr-27-2006)
So...now what?
Does this file **need** to be in the Windows folder?
Which version is preferred?
p.s., running mediawiki (wikipedia software) on this framework and everything seems to be working just fine. And my php test file runs as well.
Replies to two last comments: (everybody is using Anonymous to comment so I'm sorry I can't refer to you by name)
The reason I wrote "install package won't work" is because it did not work when I tried it. Calling something that does not work "limited" is for politicans and software giants ;-)
Maybe they've fixed it and it does work now, I wouldn't know because I haven't tried installing PHP since I wrote these instructions. If anybody knows, please comment.
Short answer to the question about libmysql.dll - Sorry, I don't know.
My guess however is that the dll being used is the one in your PHP package and since that is the latest (according to the date stamp) I would think that is a good thing.
Very good post. I found it extremely helpful.
Great instructions!
But I'm having a problem installing PHP 5.1.4, MySQL 5.0, and mediawiki on WinServer 2003 SP1 and IIS6. I installed PHP using your instructions and the test works great. (I copied libmysql.dll to windows/system32.)
However, I get the message "You are not authorized to view this page" when I url to my mediawiki.
The mediawiki install instructions say to set the PHP extension to php-cgi.exe instead of php5isapi.dll.
Any ideas on what to use or how I can make this work? I know my question is way beyond PHP, but I'm a novice on PHP, MYSQL, and wikis and lost.
Thank you so much. After a couple of failed attempts (well, duh, if they had succeeded...) I found these instructions and they worked perfectly. No reboot or restart of IIS required on my machine.
THANKS,, this is the easier so far I can found on google..how to install php on iis 6,
Thank again...keep up good tips/howto..
Thanks for the help!
I was getting 404 errors, then removed everything and followed your steps (I had done them all already), but I had also configured a php.ini - I think something was not right in the file. Now my pages are working fine.
So Cool! - These instructions worked perfectly. Up and running in zero time. thanks for the great effort
Steelryno - Dundalk, MD
Hi,
I'm getting 404 error...
i tried the steps couple of times.. but still gettting this error.
Pls help me.
I'm using W2k3 Server, IIS6, PHP 5.1.4
Kiri
You sir, are a legend, Thankyou, I have been banging my head trying to get this to work for ages.
The libmysql file that comes with MySql is the newer version of the file. There is an explanation of it on the MySql website.
http://dev.mysql.com/downloads/connector/php/
It was very useful. Thank you! I also had another problem. I put in console to check all loaded modules:
>php -h
So it returned some errors "can't load mysql module" and "Missing MSVCR71.dll". When I downloaded and installed MSVCR71.dll all errors gone amd modules start loading perfectly. Check if MSVCR71.dll located in your "C:\WINDOWS\system" directory.
i have the problem. the time execution was time out....
i;m using windows XP, with IIS 5.1 and PHP version 5.1.4
please help..
Excellent tutorial indeed. Very good work and everything is very clear and good explained.
Thanks for your time and effor to help others out.
When I run this in my browser
http://localhost/test.php
All I get back is the text showing. Is this correct?
Thanks from Canada
To Canada,
no -- you should get a lot (about two pages full) of text of information about PHP.
I'm new to this, but for the guys getting server not found errors, get into IE and turn off those "friendly error" messages. You sohuld get the ugly 403.1 etc messages.
I got a 403.1 about executing scripts -- make sure you go to the Home Directory tab in IIS website properties and set Execute permissions to Scripts and Executables.
Thanks for the HowTo. It was well written and informative. I had issues after following these steps because I had previously taken the lazy way out and this auto-installer. This had a different ISAPI extension configured. I changed the path of the executable to C:\PHP\PHP5ISAPI.DLL while following your instructions, but an IIS restart (old habit from my Apache days) changed it back to c:\PHP\php.exe. I made the change again and all is well.
Thanks!!
Juice
Great tutorial! Made that so simple, thanks so much!
Excellent article chap, had been baning my head on this issue for a few hours, this article was very helpful for me to regain focus.
Cheers!
Thank you very much for this. The whole deal really had me stumped. Thanks again.
Thank you!!!
Sir I thank you as much as the others
However for the sake of completeness and accuracy, and remembering that un-sophisticated users like myself are turning to you in desperation could you amend step 4b to make clear that the extension entered is ".PHP" and not "PHP", otherwise the OK button remains greyed-out
That was awesome I was working on this all day and after reading your explanation it took all of 5 minutes. Thanks!!
are the instructions similar using IIS 5.x?
thanks!
~ edd
THANK YOU! I spent hours trying to get this to work before finding your instructions. In less than 10 minutes my site is working perfectly!
New to PHP, using Windows XP Pro, Mysql, Apache 2.2, and PHP.
I was getting a 403 "Not Authorized" error. Was reading this blog, read the note above about changing the "friendly error messages" flag. Un-selected the flag, now test.php is trying to be downloaded.
Any help is much appriciated!!
Excellent, clear step by step Instructions, really helpful. up and running within 10 mins. Thanks Buddy!!
It is very usefule.
I've tried everything in this post and everywhere else I can find, however I still can't get mySQL to load. PHP works fine, phpinfo() returns correct information, mysQL.dll and libmysql.dll are in the right locations, yet I get an error "cannot load mysql extension". Please help!
I'm using PHP5 from the zip file, IIS6, W2003.
"On 64-bit Windows, the World Wide Web Publishing service does not support running 32-bit and 64-bit worker processes concurrently on the same server."
oops. don't try php on your x64 server if you also need to run asp.net apps (or any other x64 based app!). ugh.
Is there anything to do to the php.ini file using your 5 easy steps?
Following your directions to the T (which were super easy thank you!), when i run my http://localhost/test.php
It's like it's not detecting my c:\windows\php.ini !!! Arrg this is so aggrevating.
I've restart the PC, I've restarted World Wide Web Publishing Service and nothing!
I'm running:
win2k3 w/ sp1, iis6, PHP 5.1.4
any ideas?!
thanks,
rudy
PS: how do i "know" that it's not detecting my php.ini?
Well i turn "display_startup_errors = On"
and when I restarted the PC and then restarted WWWPS, my test.php page shows the "display_startup_errors" as being off!
I too had problems with pages not showing up. If I set the web site to a directory below the wwwroot folder or any other folder on the (dedicated) server, I would get an error. It wasn't until I had a phpinfo page in wwwroot and accessed it directly that I realized that IIS was confusing the directories.
I opened php.ini and found that the root dir was set to wwwroot. I commented this out (because I will be running several web sites on the server), and it worked.
Thank you very very much!!!
I've been spending weeks trying different instructions but failed to work.
You are really great!
Your children will be pround of what you did.
Just to highlight one minor but enough to make me panic mistake. Please remember to right click on your web site and select the "start" option.
so happy! Yeh! yeh! yeh!
Once again
I followed your instructions and this is my resulting predicament. Wondering if you can help...
I have all of our sites in a inetpub directory on the D drive, so the test.php file is located at D:\inetpub\domainx.com\www\test.php (the root of the site being www). The default web site for this machine is still pointed to C:\inetpub\wwwroot. Now, when I try to bring up www.domainx.com/test.php I get page cannot be found. I tried http://localhost/test.php and that worked, even though the file is not located in the root of localhost (default site), it is in the root of domainx.com. Weird. PHP is basically working only on the default web site and directory but getting files from the intended location (domainx.com root)? I am not sure what is going on and very much would appreciate any help.
If you are getting "The page cannot be found" error you might to verify the the .PHP extention is beign handled properly. You can do this by following these instructions:
Click the Home Directory tab, and click the Configuration… button. On the Mappings tab, find the PHP extention. If it is not there you can add it by clicking the Add button. Choose your php5isapi.dll file as the executable (note that the file type filter in the dialog is set to show .exe files only by default) and type .php in the extension box (including the .). Leave everything else unchanged and click OK.
Is it possible to have support for both .php and .asp files simultaneously on the same iis? Are there extra configurations needed?
Nice one! A Simple task made simple! - It might be worth adding as I found that on Windows Server 2003 SP1 IIS6, I had to give the IUSR account read permissions on the PHP folder so that the web user could run the PHP5ISAPI.DLL - All works great!
Very good post. All worked well except that when I tried to access the PHP document from a web browser I get the Authentication window. I added prividges to the php directory, executible and dll. Anyone else having this problem on Windows SBS 2003?
Dan
brilliant brilliant brilliant !! however, I got an error that said something about CGI misbehaving - I changed the PHP extention under CONFIGURATION in IIS to the ISAPIDLL and it all works fine now. you are a god !!
Spot on, took under 5 mins to do the lot. Really great instructions.
I used your not-as-succinct installer from a few months ago and was so very happy when it worked, and that this condensed version works as well is to say the least very pleasing. Well done, keep up the good work.
A few of you were being prompted for a userid and pw for the PHP pages. I had the same problem and have a solution.
I was working on a Win2k server with "Integrated Windows Authentication" turned on for my PHP application in IIS. I gave IUSR "read", "execute" and "List folder contents" permissions on the PHP installation directory. Anyway, it all worked fine for Win2k workstations. Users who were accessing the PHP application with WinXP clients were prompted for a userid and password. To fix this, I had to give "read", "execute" and "List folder contents" permissions to the "Authenticated Users" group on the PHP installation directory.
I hope this helps.
ERES UN PUTO GENIO!!! JAJAJA!!!
Muchísimas gracias, llevaba tiempo intentándolo con el instalador e incluso a mano y no era capaz. Gracias de nuevo desde España!!!
Thank you, I appreciate this link and your help.
In not so many words:
Thanks that was all that I needed
Kind Regards
John Vishart (DK)
Thank you very much. I can't believe how long the install.txt file is and how short and clear it could possibly be!
These are the cliff notes for sure! very nice.
I was able to get this to work on Windows 2k sp4, with IIS 5.
However, I don't see the the web service extension folder or how to configure that. It might be that I simply have no web service extensions like Front page configured.
Anyways.. Many thanks!
jc in miami
jc_pineiro[at]yahooooo[dot]cooooom
Outstanding job, Tjitjing! Our installation was went flawlessly.
Hmmm....
After having a successful installation based upon your directions, I had reason to stop then restart the web services. Since then, I have not been able to get the PHP test page to run!!
I rebooted the server, still the same problem: "The Page cannot be displayed".
Any ideas?
Please email swhitney [at] whitcom.com.
Thank you.
Great Job!! You just saved my day. Is there a tutorial to install Zend Optimizer 3.0.1 on PHP install?
Very good tutorial! Thank you!
after installation php5 as it was given here i got an error "The page cannot be found" and whatever i do i dont get test.php when i write http://localhost/test.php.
please any ideas?
Nice post. I'd like to make a couple of suggestions.
1) As an amendment to your step 3: Create a new System Variable called PHPRC and give it a value of "C:\PHP\"
This will allow you to create your php.ini directly in C:\PHP\ and avoid having to deal with cluttering up the C:\WINDOWS\ directory.
2) You can also put any needed DLLs (like LIBMYSQL.DLL) inside the C:\PHP\ directory (as opposed to putting them in C:\WINDOWS\SYSTEM32). To enable this functionality you simply need to modify one line in your php.ini: "extension_dir = "C:\PHP\"
This just helps keeps things more clean IMO. Also makes life easier on permissions. This way you can set permissions once on the php folder and be done with it!
Hi
Great tutorial.
One comment I would like to add though.
I was having a lot of problems and kept getting the following error message when trying to open test.php
==================================
You are not authorized to view this page
You do not have permission to view this directory or page due to the access control list (ACL) that is configured for this resource on the Web server.
HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL set on the requested resource.
Internet Information Services (IIS)
==================================
I had sort of given up on getting the ISAPI to work untill I read that you had to give the IUSR_(systemname) read rights to the PHP folder.
Well, that didn't work
Untill I went in to the advanced section of the security rights for the folder and told the system replace permission entries on all child objects.
This made the whole issue disapear. Maybe you should add this as a sidenote to your tutorial. :)
Thanks anyway!!!
GreetZzZz
Thank you for all feedback, tips and questions! I just updated the post to make sure people don't forget to check the comments which seems to include great solutions to some common problems.
Just to let you know why I don't try to answer many questions here - I simply don't know the answers to them. I no longer use php. I wrote this guide when I (with some difficulty) installed php a couple of years ago. I then did two projects in php but haven't really touched it much since then, except for some maintenance.
It's not that I don't like php but currenlty I'm doing most of my projects in asp.net/vb.net and I guess I just find it easier to focus on one development tool.
i have windows server 2003 + iis 6 but its on an itanium 64 bit server. how do i rup php. any help would be greatly appreaciated.
~pushkarg2007@email.iimcal.ac.in
I am using WinXP and IIS5 and want install PHP5.1. I cannot click on OKAY in the Mapping-tab of "Application Configuration" in IIS, it is greyed-out. I want to choose "C:\PHP\php-cgi.exe" and extension "php".
Excellent stuff, I was so impressed with this tutorial and had a server setup 10 minutes with it.
Thanks
Couldn't be more straigh-forward. Thanks for the help.
I used your instrutct to load up on Windows Media Editon as well. Everything was pertinent except for the web services. Thanks for saving me the time of printing and reading the install instructs!
-nintender
Ragster,
Did you try extension ".php" as posted earlier?
Thank you so much! There was much head-scratching going on here until I read your tutorial. Web Service Extensions did the trick!
I followed your simple instructions and I get the message - "The device is not ready." Any ideas why I'm getting this error when I run http://localhost/PHPTest/test.php?
Thanks - Angel
After install php 5.1 + and mysql 5.0+ the server is auto shutdown in an hour... I'm usng windows server 2003 with MS-SQL 2000. I don't know if there a conflict as startup service. Anyone have this issue before? Thanks
Thanks a lot... It works great..
ESTIMADO:
MUCHAS GRACIAS FUNCIONO !!!!!
This is an excellent guide!
Just a hint to other PHP newbies like me: If you get a Service Unavailable (503.x) error when attempting to load up your PHP page, make absolutely sure that the PHP directory is in the Windows PATH environment variable and that you have rebooted your server for that change to take effect.
Cheers,
Max.
Extremely easy directions to follow...it took longer to FIND these simple instructions than it did to implement them...If only all tutorials were this easy ! Thanks !
My whole server f**ked up after using this tutorial, nothing worked, I got an 404 error, then after changing it to set Execute permissions to Scripts and Executables to work I got a 403/403.2 error pages.
This tutorial is sh*t!!
This tutorial worked like a charm, now I have to install MYSQL. Thanks for the help, the PHP instructions left out a few steps.
-Darren
San Francisco
im actually in starter state...
kindly help me..
i've installed my php...
now i have saved a file with .php containing html tags enclosed to my php tag...
im not able to view the content of my page... im only viewing a blank page... if i remove the html tags im seeing the the php code in web page... kindly say me about my problem and try to rectify it.....
thank you so much!
just a little comments here:
the sequence of your steps are so important! I set up a few machines successfully, but yesterday I lost on one machine, later on I found I set step 4.b first and then step 4.a, it is strange but maybe useful to someone like me.
Hi,
Great tutorial !
However, you don't have to copy any DLL files into your Windows system folder - you merely need to set the PHPRC environment variable. I've written a HowTo guide which you may find helpful here :
http://www.iis-resources.com/modules/AMS/article.php?storyid=615
Regards,
Paul Lynch
Dear sir,
I'm Lusi, comp science student of univ of indonesia. Currently, I'm doing internship and develop web-based apps using PHP 5.0.5, IIS 5.1, and MSSQL Server.
My system could run smoothly on my PC and my notebook. But when I try to deploy in this company's production server, my system could't running perfectly. This company also use PHP 5.0.5, MSSQL Server, but they use Win Sever 2003 and IIS 6.
There are some features that didn' work, that is feature that using session. I could not do "Login", etc. Is it caused by different IIS settings or do you have any idea? There are some notice like Undefined index and Undefined offset. Please help me. The administrator there also have no idea.
I want just to precise anything. This tutorial works in WIN2K3 but not in WIN2K3SP1. If any body can validate this point. i've made the test and i don't understand why it's not working. I'm besame really silly.
it 's ture,in sp1 it's not working
To anonymous in last two comments:
Hi,
as stated in the post this is tested on win 2003 sp1, so at least I got it working when I wrote the tutorial.
Excellent guide. I was about to give up after using other guides on the net but this did the trick. I did encounter the 401.3 error upon trying to view test.php initially but that was resolved by giving read access with inheritable permissions for the IUSER_MACHINENAME for the C:\PHP dir. Thanks!!!
Don't forget to change the Properties of your web sites to allow scripts to run - use IIS > website you want to enable PHP on > Properites > Home Dir > Execute Permissions = scripts only
This is a very nice tutorial, useful for those new to system administration on Windows.
I did see that a few people had asked how to get PHP to work on x64 architectures, even some comments that it wasn't possible. I've been going around working on that myself, though you might want to consider adding these to your post for x64 architectures...
- It is possible to run PHP on an x64 system, however you will have to update your x64 .NET Framework 2.0 install after doing the following
- Open up a cmd.exe window, and navigate to your Inetpub\Adminscripts directory
- Type in the following line:
adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
- That will tell IIS to run in x86 compatibility mode, again making your ASP.NET ISAPI filter temporarily unable to start. Just run your updates for the .NET Framework 2.0, and it'll throw a 32-bit version in there instead
Also, I had a rather advanced question for you that's been bothering me for -quite- some time. With IIS 6.0 on Windows Server 2003 R2 and MySQL 5.0.x, I have yet to be able to get PHP to connect to a MySQL database. I always receive a "Can't create TCP/IP socket" error. Have tried adding PATH variables, moving mysql libraries around, enabling named-piping in MySQL, but all to no avail. I'm actually getting rather desperate, so if you've got a few spare moments and care to help me out, please let me know by emailing me at amale@zibings.com. Thanks in advance, and I hope the x64 additions can help someone.
Very nice job.
Thanks for taking the time to post your experience. Unfortunately, this method did not work for me. I even tried copying the php5sapi.dll into the system32 folder.
Perhaps this comment could help others. I used the php-5.2.0-win32-installer.msi and it worked perfectly. But, one must add Filter Name "php" and Executable "C:\PHP\php5isapi.dll" under IIS Manager -> Web Sites -> Properties -> ISAPI Filters.
Additionally, I like to run my PHP scripts using a different extension (just to keep'em guessing). You can do this by adding the extenison you want to use (example: ".jon") under IIS Manager -> Web Sites -> Properties -> Home Directory -> Configuration -> Mappings -> Application extensions. Just enter the extension and point it to "C:\PHP\php5isapi.dll" (assuming you installed PHP under C:\PHP\). If it tries to tell you that the executable is already in use by .php, just close the window and it will take.
I hope this helps someone.
Thanks for taking the time to post your experience. Unfortunately, this method did not work for me. I even tried copying the php5sapi.dll into the system32 folder.
Perhaps this comment could help others. I used the php-5.2.0-win32-installer.msi and it worked perfectly. But, one must add Filter Name "php" and Executable "C:\PHP\php5isapi.dll" under IIS Manager -> Web Sites -> Properties -> ISAPI Filters.
Additionally, I like to run my PHP scripts using a different extension (just to keep'em guessing). You can do this by adding the extenison you want to use (example: ".jon") under IIS Manager -> Web Sites -> Properties -> Home Directory -> Configuration -> Mappings -> Application extensions. Just enter the extension and point it to "C:\PHP\php5isapi.dll" (assuming you installed PHP under C:\PHP\). If it tries to tell you that the executable is already in use by .php, just close the window and it will take.
I hope this helps someone.
If someone get the error "cannot load mysql extension" on Apache/IIS at Windows, you just need to copy the "libmysql.dll" into your system32 dir (e.g. "C:\windows\system2"). :)
:(I got a 403.1 about executing scripts
i did something and the page worked but the page was blank. can you help me I have been banging my head trying to get this to work for ages:(
I need some help with my Windows Server 2003. I just recently installed SP1, and after the automatic reboot, it goes to the screen with the moving bars, but never gets me to my login. Then it restarts over and over. Is there a way to uninstall it and get my previous setting back? Plus there was no System Restore installed. My e-mail is erics8463@yahoo.com.
I need some help with my Windows Server 2003. I just recently installed SP1, and after the automatic reboot, it goes to the screen with the moving bars, but never gets me to my login. Then it restarts over and over. Is there a way to uninstall it and get my previous setting back? Plus there was no System Restore installed. My e-mail is erics8463@yahoo.com.
Great job! Many thanks.
One more appreciative user of your instructions saying "THANKS!"
Step 4 a Web Service Extension
Now where is this web service extension?
I am using IIS 5.1 on Windows Xp Professional
FINALLY SOME EASY AND ACCURATE INSTRUCTIONS!!!!
FINALLY EASY AND ACCURATE INSTRUCTIONS!
Thanks a million!
I was getting desesperated, but you saved my day!
Thanks a lot!
I used IIS on XP professional. Just skip item 4a and it works!
You're a life-saver! I was struggling with a MediaWiki (PHP & MySQL-based) installation on IIS6. The wiki setup wouldn't hook up to MySQL. Finally, saw your note about adding libmysql.dll to the C:\Windows dir, did it & it worked!!!!!! Thank you!!!!
Great!
I am think that adding to this turtorial apache/php will be useful.
great work man.
you have nade life for many real easier.
regards
Noman
(www.makePakistanBetter.com)