Install the PHP Application Server (Windows)
To work with dynamic WEB pages, you need an application server. An application server is software that helps a Web server process Web pages that contain server-side scripts or labels. When a browser requests such a page, the WEB server passes the page to the application server for processing before sending it to the browser. For more information, see Understanding WEB applications.
Make sure that the PHP application server is installed on the system running IIS and is running. (IIS may be located on your hard disk or on a remote Windows computer.) You can download and install the PHP application server from the PHP Web site (www.php.net/downloads.php).
In PHP 5, Windows installer does not install or enable extensions that allow PHP to handle MySQL database servers by default. You must install and enable the extension manually.
To install PHP 5 on a Windows system, do the following:
- If possible, log on to the Windows system using an administrator account.
- Download the Windows PHP 5.x installer from the PHP Web site www.php.net/downloads.php.
- Double-click the downloaded installer file and follow the on-screen installation instructions.
- After successfully installing PHP, download the Windows PHP 5.x compression package from the PHP Web site www.php.net/downloads.php, and then unzip the package to a temporary folder on your hard disk. The package contains the extensions that are required to handle MySQL.
- In the temporary folder that contains the uncompressed file, locate the folder named Ext and copy it to the C:\PHP\ folder. The Ext folder contains commonly used PHP extensions, including MySQL extensions.
- In the C:\Windows folder, locate the file named PHP.ini, and open the file in Notepad. You must edit the file to enable the MySQL extension.
- Locate the following line in the php.ini file: Extension_dir = "./" The row specifies the location of the PHP lookup extension.
- Edit the line as follows: Tip do not ignore the last slash. Extension_dir = "C:\PHP\ext\"
- Locate the following line in the php.ini file: "; Extension=php_mysql.dll" the semicolon at which the line begins (;) Instructs PHP to ignore the row.
- Delete the semicolon at the beginning of the line to enable the extension to become: "Extension=php_mysql.dll"
- Save and close the php.ini file.
- In the temporary folder that contains the uncompressed PHP file, locate the file named Libmysql.dll and copy it to the C:\Windows\system32 folder. IIS handles PHP 5 and MySQL requires this file.
- Restart IIS.