Home > Article > Backend Development > How to install PHP and IIS server under Win7
Under the Win7 operating system, most website developers and administrators use IIS (Internet Information Services) server and PHP as the development and operating environment. If you also want to use IIS and PHP under Win7 to develop and test your website, then you need to know how to properly install and configure IIS and PHP. In this article, we will learn how to install IIS and PHP under Win7 operating system.
1. Install the IIS server
2. Install PHP
a. Find the following two lines and uncomment them (remove the preceding semicolon).
extension_dir = "ext" ;extension=php_mysql.dll
b. Find the following two lines and modify them to the relevant configuration information of your MYSQL database (such as IP address, user name, password, etc.).
mysql.default_host = "localhost" mysql.default_user = "root" mysql.default_password = ""
c. Find the following two lines and modify them to the relevant configuration information of your SMTP server (such as IP address, port, username, password, etc.).
SMTP = localhost smtp_port = 25
a. Open the IIS management console, find the virtual directory of the corresponding website, and right-click the directory and select "Properties" ".
b. In the properties window, select the "Home" tab and click the "Add" button.
c. In the Add window, enter "index.php" (or the name of your desired PHP file) and click the "OK" button.
d. In the properties window, click the "Configure" button and enter the following information in the "Add" window:
ISAPI或CGI 可执行文件路径:C:\php\php-cgi.exe(或你的PHP解压路径下的php-cgi.exe) 扩展名:.php MIME类型:application/x-httpd-php 注意:如果你的PHP版本不同,你需要相应地修改可执行文件路径。
e. Click the "OK" button and restart the IIS server.
3. Test PHP
In your Web root directory (such as C:\inetpub\wwwroot), create a file named phpinfo.php, and Enter the following code:
phpinfo();
?>
Finally, when you successfully install and configure IIS and PHP, you can start writing and testing various types of web applications using PHP under Win7.
The above is the detailed content of How to install PHP and IIS server under Win7. For more information, please follow other related articles on the PHP Chinese website!