龙鱼家园,个性,交流,技术,专注于网站技术的研究 龙鱼家园 | How To Install IIS 7, PHP5 and MySQL 5.1 on Windows Server 2008 – Part 2
 

How To Install IIS 7, PHP5 and MySQL 5.1 on Windows Server 2008 – Part 2

Following up on my last post, I’ve now got a working IIS 7 web server running on Windows 2008. We’re now going to install PHP5 and MySQL 5.1.

PHP.netInstalling PHP5 on IIS 7

First of all, grab yourself a copy of PHP over at http://www.php.net/downloads.php. I always use the zip package, I never use the installer. The installer only installs and configures the CGI version of PHP which is not the best solution for an IIS web server. I prefer using the ISAPI version.

At the time of this writing, the latest PHP version is 5.2.5.

  1. Download the latest PHP version for Windows and unzip its content in a temporary folder on your hard disk.
  2. When you’re done, create a folder named php at the root of your hard drive (e.g.: c:\php).
  3. Move all the content from the extracted archive to c:\php
    php-dir.jpg
  4. Rename the file c:\php\php.ini-recommended to c:\php\php.ini and open it with your favorite text editor (no word processor).
  5. Find the extension_dir parameter and set its value to “c:\php\ext”. Save the file and exit the editor.
  6. Launch the registry editor: Start => Run => regedit
  7. Create a new key named PHP under HKEY_LOCAL_MACHINE\SOFTWARE\
  8. Right-click on the newly created key and select New => String Value
  9. Name the new value IniFilePath and set the value data to C:\php
  10. Click on Start => Settings => Control Panel and double-click the System icon (using the class view).
  11. Click on the Advanced system settings link from the left column.
  12. From the System Properties window, click on the Advanced tab and then on the Environment Variables button at the bottom.
  13. Select the Path variable from the System Variables section and click on Edit. Add c:\php to your system path (be sure to include the semi-colon separator).
    windows2008-system-properties.jpg
  14. Click on OK until you’ve exited the System Properties window .
  15. Launch the Internet Information Services Manager: Start => Programs => Administrative Tools => Internet Information Services (IIS) Manager
  16. From the IIS Manager, click on your server’s hostname from the Connections panel on the left. Double-click on Handler Mappings icon.
    iis7-handler-mappings.jpg
  17. From the Handler Mappings actions panel, click on Add Script Map…
    iis7-add-script-map.jpg
  18. Fill-in the information as illustrated below and hit OK:
    iis7-php-script-map.jpg
  19. Click again on your server’s hostname from the left panel and double-click on the ISAPI And CGI Restrictions icon.
  20. From the Actions panel on the right click on Add…
  21. Enter the information to allow PHP processing as illustrated below and hit OK:
    isapi-cgi-restrictions.jpg
  22. Click on your server’s hostname form the left panel and double-click on the Default Document icon.
  23. Click on Add… from the actions panel on the right.
  24. Enter index.php in the new default document name and click on OK.
  25. Click on your server’s hostname from the left panel and then click on Restart from the actions panel on the right.
  26. Create a new text document and save it to c:\inetpub\wwwroot\phpinfo.php with the following content:<?php phpinfo(); ?>

If everything is ok, you should now see the PHP information page at http://your-server-name/phpinfo.php:

windows2008-iis7-phpinfo.jpg

Stay tuned for my next post on how to install MySQL 5.1 on Windows 2008.

http://www.thewebhostinghero.com/tutorials/install-iis7-php5-mysql5-win2008server-pt2.html


Search

友情链接

  • 微足迹
  • 资质通鉴
  • 译言
  • 代码发芽网
  • 清清月儿
  • 二频
  • dotnetblogengine
  • 苹果树下
  • 联系我:
    leonardleonard@126.com

    © Copyright 2012