Wednesday, April 16, 2008

Configure PHP in IIS

Installing PHP in IIS is quite tiring than PHP and Apache.
The following steps are the easiest ways I know.


PHP side:
1. Open C:\php\
2. Copy pphp5ts.dll to C:\Inetpub\wwwroot and C:\WINDOWS\system32
3. Copy php.ini-dist to C:\Windows and rename it to php.ini
4. Open C:\WINDOWS\php.ini
5. Find the following and change:
doc_root = to
doc_root = "C:\Inetpub\wwwroot"
;cgi.force_redirect = 1
to
cgi.force_redirect = 0
6. Save and close php.ini

IIS side:
1. Right click My Computer and choose Properties
2. Go to Advanced tab -> Environment Variables
3. Search for PATH, then click Edit
4. Add this at the end of the line:
;C:\php
5. Click OK and reboot the computer.
6. Go to
Control Panel -> Administrative Tools -> Internet Service Manager
7. Right click Default Web Site and choose Properties
8. Go to Home Directory tab
9. Click Execute Permissions dropdown menu and choose Scripts Only
10. Click Configuration and press Add
11. Set Executable to C:\php\php5isai.dll and set Extension to .php
12. Press OK
13. Go to Isapi Filters tab and click Add
14. Set Filter Name to PHP and Executable to C:\php\php5isapi.dll
15. Click Apply, then Select All, then OK.

Restart side:
1. Right click MACHINENAME (local computer) -> All Tasks -> Restart IIS
2. Open Notepad and paste the following:


3. Save as phpinfo.php
4. Save phpinfo.php to C:\Inetpub\wwwroot
5. Test if php will be shown (http://localhost/phpinfo.php)
6. "PHP" + "tables" + "colors" etc -- well done!

No comments:

Post a Comment

^___^