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
- First, we need to open the Control Panel and select the Programs and Features option.
- Click the "Turn Windows features on or off" link on the left.
- In the Windows function window, find the Internet Information Services node and expand it.
- Select the Web Management Tool (World Wide Web Services) node and all its sub-nodes below it (if you need to install other IIS support services, you can also select their sub-nodes).
- Click the "OK" button and wait for the installation of the IIS server to complete.
2. Install PHP
- First, we need to download the latest version of the PHP binary distribution, which can be downloaded from the official website (https://windows.php.net/ download/) to download.
- After the download is completed, unzip the downloaded PHP folder to the path you want to install (such as C:\php).
- In the unzipped PHP folder, find the php.ini-development file (or php.ini-production file), copy it and rename it to php.ini.
- Open the php.ini file and make the following changes:
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
- Add PHP support in IIS
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();
?>
- Open the browser and visit http: //localhost/phpinfo.php, if everything is normal, you will see PHP related information.
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics









