Window + nginx + php environment configuration with configuration instructions

Source: Internet
Author: User
Tags php download

1. Download PHP
There are many php Download versions, among which,
Vc9 = vs2008 compilation. We recommend that you use the IIS + php combination mode,
Vc6 = vs6 compilation. We recommend that you use apache + php,
Thread Safe: Thread security. During execution, the Thread security check is performed to prevent the new Thread from consuming system resources by starting the CGI execution mode. Non-Thread Safe is Non-Thread security and does not perform Thread security checks during execution.
Non Thread Safe,
Let's take a look at two PHP Execution Methods: ISAPI and FastCGI.
The ISAPI is executed in the form of a DLL dynamic library. It can be executed after a user request. After processing a user request, it will not disappear immediately. Therefore, thread security check is required, in this way, the program execution efficiency is improved. If you use ISAPI to execute PHP, we recommend that you select the Thread Safe version;
FastCGI executes operations in a single thread, so it does not need to perform thread security checks. Apart from the thread security check protection, it can improve the execution efficiency, if you use FastCGI to execute PHP, we recommend that you select the Non-Thread Safe version.
We do not recommend that you use Non-Thread Safe in the production environment. Therefore, we use PHP of Thread Safe.
2. Configure php
Decompress the package to a directory, such as c:/php345.
Rename php. ini-development to php. ini.
Fastcgi. impersonate = 1 The default value is 0. If IIS is used, you need to enable: cgi. fix_pathinfo = 1
Cgi. force_redirect = 0 is enabled by default. If you use IIS, you can disable it.
Specify the extension_dir directory and the date. timezone directory.
Extension_dir = "C:/php53iis/ext"
Date. timezone = Asia/Shanghai
Modify cgi. fix_pathinfo = 1 in the PHP. INI configuration file. PHP will modify SCRIPT_FILENAME to the actual file address. Otherwise, PHP will not be able to find the PHP file to be processed.
3. Configure nginx
Decompress nginx, such as c:/nginx
  
Set the directory where error. log is stored. Set the # location of # error_log logs/error. log;. By default, error. log is stored in the logs directory in the Nginx installation directory.
  
Set the WEB Server Directory, similar to document_root in the PHP. INI configuration file. The information in the Nginx configuration file is as follows:
Copy codeThe Code is as follows:
Location /{
Root D:/PHPWeb;
Index. php index.html index.htm;
}

Copy codeThe Code is as follows:
Location ~ \. Php $ {
Root D:/PHPWeb;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME D:/PHPWeb $ fastcgi_script_name;
Include fastcgi_params;

Note: Modify/scripts in fastcgi_param SCRIPT_FILENAME to the previously set WEB directory. Otherwise, an HTTP 404 error will be reported.

Modify cgi. fix_pathinfo = 1 in the PHP. INI configuration file. PHP will modify SCRIPT_FILENAME to the actual file address. Otherwise, PHP will not be able to find the PHP file to be processed.
4. Run
Download RunHiddenConsole
Firewall supports RunHiddenConsole C:/php52iis/php-cgi.exe-B 127.0.0.1: 9000-c C:/windows/php. ini

From: http://www.cnblogs.com/ihwt/archive/2010/12/18/1909742.html

If you want to save trouble, you can use the following software to quickly deploy the Nginx-based php runtime environment:
Http://www.jb51.net/softs/33785.html

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.