In this tutorial you will learn how to configure php in iis step by step or you can say how to install PHP 5.5 in IIS 7.5 on Windows 7 PC.
Now follow the following steps to install php on windows 7 pc.
1. Download PHP from the following link
2. Extract the zip file. Copy the unzipped file folder in C:\ for better accessing. Now you can rename the folder to php or just leave as it is.
3. To start IIS press Windows button + r to start run command. Type inetmgr and hit enter.
Note: You need to configure IIS to run php application/websites on windows pc first. Click on the following link to read it in details.
4. Now in IIS click on Handler Mappings
5. Click on Add Module Mapping
6. Enter *.php in request path
7. Browse and locate php-cgi.exe in your extracted php folder.
8. Give it a name for example PHP-CGI
9. Click on Request Restrictions then check the checkbox and select File or Folder radio button then Ok and click Yes. [Check Figure 2 and Figure 3]
10. Now open your php installation folder in windows explorer
11. Select either php.ini – development or php.ini – production and rename it php.ini
12. Open php.ini file in a text editor and the following lines at the end of the file then save and close it.
error_log=C:\Windows\temp\PHP5_errors.log upload_tmp_dir=C:\Windows\temp session.save_path=C:\Windows\temp cgi.force_redirect=0 cgi.fix_pathinfo=1 fastcgi.impersonate=1 fastcgi.logging=0 max_execution_time=300 date.timezone=[Your Time Zone] extension_dir="C:\Your PHP Directory\ext\" [ExtensionList] extension=php_mysql.dll extension=php_mysqli.dll extension=php_mbstring.dll extension=php_gd2.dll extension=php_gettext.dll extension=php_curl.dll extension=php_exif.dll extension=php_xmlrpc.dll extension=php_openssl.dll extension=php_soap.dll extension=php_pdo_mysql.dll extension=php_pdo_sqlite.dll extension=php_imap.dll extension=php_tidy.dll
13. Double click on Default Document in IIS
14. Click Add in Action pane
15. Enter index.php and click Ok.
16. To test successful php installation create a directory anywhere in your pc
17. Open notepad then write
<?php phpinfo(); ?>
and save the file as index.php
18. Now go to IIS and right click on Default Web Site then Add Application
19. Enter any Alias Name then browse and locate your folder where you have just created index.php file
20. Click Ok to close the dialog box.
21. Now right click on the application you just added in IIS
22. Click on Manage Application then Browse
If you see a webpage like the following image then your php installation is successful.