Since this can be a pain in the a^&, and Jordan wanted a tutorial, I thought I would post this here (and not to mention that I can use it for future reference).
First, I have never successfully installed php / mysql together on server 2003 without at least something going wrong. While writing this tutorial, it was permissions on the php directory. I am going to install php 5.2.6 and mysql 5.0.67 to IIS 6 on Server 2003 Enterprise Service Pack 2.
1. download php 5.2.6 (ZIP only, don't get the msi because you will have problems) and mysql 5.0.67 from their sites, you may need to make their sites trusted to download from them due to IE's enhanced server security.
2. copy the php unzipped directory to c:\php526 (my choice, you can choose another location).
3. copy my php.ini file to c:\php526 and change extension_dir inside of it to c:\php526\ext or whatever directory you are using
4. goto the iis panel and add new webservice extension, name it PHP, and add required file: C:\php526\php5isapi.dll and allow extension.
5. now we need to update path variables for windows
a. right click my computer, goto properties, goto advanced, click environment variables
b. find path, and add: ";C:\php526" to this and ok it.
c. Click new, variable is "PHPRC" and value "C:\php526" ok it. Then ok the properties of my computer.
6. now we need to give network service permission to access php, goto my computer, click on c:\ then right click your php526 folder, click on sharing and security, goto the security tab, and click on add, type in network service, ok it, and make sure it can read and execute. Then ok this and get out of my computer.
7. now we need to goto the iis control panel, right click websites, click properties, goto the home directory, click on configuration, click add. Executable is "C:\php526\php5isapi.dll", extension is php, and limit verbs to: "GET,HEAD,POST", then ok it. Also, enable execute permissions under home directory to scripts and executables.
8. goto the documents tab and add index.php to the default file list and ok everything.
9. from the iis panel, right click your server name and goto tasks>restart IIS, php is now installed with mysql support!
10. start the mysql installer, install with typical settings, afterwards, configure it
11. Lets select detailed configuration settings, this will be a server machine (I have 2GB of ram on this server, which should easily support this, 512MB of ram should suffice as well). We want a multifunctional database, decision support is fine (select more if you plan on high usage), make sure you allow a firewall exception if you need people to use the server remotely. strict mode is fine, standard characters, windows service are both fine, but check bin extension for command line use. finally enable root access, I also allowed remote root, but it isn't needed. I did not enable anonymous connections. Hit execute at the end, then finish.
12. Now if everything worked correctly, php and mysql should be installed. Try uploading a php script such as
and running it, it should work fine. Mysql should show up in this as well.Code:<?echo phpinfo();?>
Congrats, your server is now set up as a php, mysql and iis server if you didn't run into a problem. If you have questions or run into trouble, let me know and I will try to help you out.
Last edited by John; 09-28-2008 at 02:07 PM. Reason: fixed mistake
Apparently I can't edit my own post after some time... There is an error above (I am using this to initialize a server):
3. copy my php.ini file to c:\php526 and change extension_dir inside of it to c:\php526\ext or whatever directory you are using
Hmm, what about using Apache though? I'm not sure about current versions of PHP but we have had a lot of issue with IIS and PHP not playing well together. In fact, it caused so many problems my boss had me move everything to Linux (which worked out for the best if you ask me). I do recall reading something about this going to improve though (PHP and MS teamed up in some way).
You can install Apache on windows, its a WAMP I believe.
My problem is, Windows comes with IIS, so not using it defeats the purpose of using the Windows Server system. Also, I'm not even sure if Apache under Windows supports ASP with the same environment as IIS does. I'm considering changing famousphil.com over to ASP just to learn ASP a lot better, but I'm not sure yet.
On x64 windows, a tip that will really help people stumped by the above, simply take the php dist ini and rename it to php.ini and change the extension directory appropriately. Also make sure that you set an environmental variable PHPRC to point to where php.ini is in path. That was what I struggled for 12 hours to get on windows x64.
Where did you get that figure? I'm curious to know how much uses PHP and Ruby.
I just took an educated guess, Windows Servers don't control much of the internet.
There however was a survey earlier this year here. By the looks of it, Windows is much higher than I thought.
Interesting, notice on the second chart there is "Google" listed as a server. I didn't realize they had a proprietary server.
I didn't know they had their own web server either. I'm considering finding it and installing it on the test server John and I share. If I do, I will probably write a tutorial or a snippet or something about my experience.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks