Erm's I.T. Girl – Zelna Ellis

Don't fear when Zel is near…

.NET & MySQL Part 3

Install PHP on Windows XP IIS Server

Download guide (PDF)

Prerequisites: IIS (Internet Information Services available on XP CD)
Version: 5.2.9
File Name: php-5.2.9-1-win32-installer.msi
Download Location: http://www.php.net/get/php-5.2.9-1-win32-installer.msi/from/a/mirror
For the latest version check it out at http://www.php.net/downloads/

  1. Run php-5.2.9-1-win32-installer.msi and wait.
    Fig 1
  2. Click Next
    Fig 2
  3. Check I accept the terms in the License Agreement check box, and then click Next
    Fig 3
  4. Change the directory to the D:\PHP\ Click Next
    Note: Do not use recommended directory Program Files, you will run into problems.
    Please take note my root drive is the D Drive, usually it is the C drive.
    Fig 4
  5. Select IIS ISAPI module and click Next
    Fig 5
  6. Expand Extensions and Select MySQL and MySQLi, and then Click Next
    Note: You can select other extensions and/or options you may need.
    Fig 6
  7. Click Install
    Fig 7
  8. Wait
    Fig 8
  9. Click Finish
    Fig 9
  10. Configure IIS to work with PHP

  11. Open IIS Management Console
    Start | Control Panel | Performance and Maintenance | Administrative Tools | Internet Information Services
  12. Select Web Sites in the Left Panel
  13. Right Click your web site in the Right Panel and select Properties.
    Fig 10
  14. Select ISAPI Filters Tab Page
  15. Click Add
  16. Type PHP in the Filter Name Text box.
  17. Browse to the installation directory and select php5isapi.dll
    Fig 11
  18. Click OK
  19. Select Home Directory tab page.
  20. Select the Mappings tab page, and then click the Add button.
  21. Click the Browse button. Browse to the installation directory and change the Files of Type to Dynamic Link libraries (*.dll). Select the file php5isapi.dll and click the Open button
  22. In the Extension text box type .php
  23. In the Limit to: text box type GET, HEAD, POST
  24. Check the Script Engine check box.
  25. Check the Check that file exists check box.
    Fig 12
  26. Click OK
  27. Click OK
  28. Click OK
  29. Important REBOOT your PC before carrying on!
  30. Test PHP

    Test Installation
    Create a new text file called phpinfo.php and paste the following into it. Save it in your wwwroot directory (default is C:\Inetpub\wwwroot )

    <html>
    <head>
    <title>PHP Info<title>
    </head>
    <body>
     <p>This is an HTML line</p>
      <?php
        echo "This is a PHP Line";
      ?>
      <p>
      <?php
        phpinfo();
      ?>
      </p>
    </body>
    </html>

    Open http://localhost/phpinfo.php in a web browser. If you see something like the following, you have successfully installed PHP!
    Fig 13

    When you scroll down you should see the mysql and mysqli extensions.
    Fig 14

    Note: According to some sources mysqli is an improved version of mysql and support some stuff that mysql doesn’t. And mysqli has better security and you can do object oriented programming (OOP).

Happy Coding!

In the next post in this series, we will have a more in-depth look on how to connect a MySQL database in Visual Studio with VB.NET

Previous Posts:
.NET & MySQL Part 1 A list of software required as well as optional software that can be used.
.NET & MySQL Part 2 Install MySQL Server

Version 1.1

24 March 2009 - Posted by | .NET & MySQL | , , , , , ,

2 Comments »

  1. Thanks for the post.

    Comment by CasTex | 25 March 2009 | Reply

  2. Thanks for this post.

    Comment by CasTex | 25 March 2009 | Reply


Leave a reply to CasTex Cancel reply