How to configure the Nginx + php environment in Windows 7

Source: Internet
Author: User

For more information about how to configure the Nginx + php environment in Windows 7, see.

I. preparations:

OS: Windows 7 SP1

Nginx: nginx-1.3.5

Php: php-5.4.6

Decompress php-5.4.6-win32-vc9-x86.zip to D: php and change php. ini-production to php. ini.

3. Decompress nginx-1.3.5.zip to D: nginx and edit the D: nginxconfnginx. conf file:

Location /{
Root html;
Index index.html index.htm index. php; # Add a PHP Homepage
}

# Cancel the following comments and modify them:

Location ~ . Php $ {
Root html;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;

# Html indicates the website directory, which must be consistent with that in root.
Fastcgi_param SCRIPT_FILENAME html $ fastcgi_script_name;
Include fastcgi_params;
}

4. Add a php-cgi.cmd file in D: nginx and write content:

"D: phpphp-cgi.exe"-B 127.0.0.1: 9000-c "D: phpphp. ini"

5. Add the index. php file of phpinfo in the d: nginxhtml folder and write the following content:

1 <? Php
2 phpinfo ();
3?> 6. Run D: nginxphp-cgi.cmd and D: nginxnginx.exe and open: http: // localhost/index. php. Have you seen the familiar phpinfo page!

VII. nginx basic commands:

Start nginx: start nginx

Nginx-s stop: stop nginx

Nginx-s quit: Exit nginx

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.