PHP nginx in Windows system stop build record

Source: Internet
Author: User
PHP Nginx to build records under Windows system

Build Nginx in conjunction with PHP under Windows System.

Get ready:

Download nginx http://nginx.org/en/download.html? Download stable version

? php5.0 and above version download

a configuration php in here is omitted, the main attention to a few aspects: the configuration of the environment variable, open the corresponding module, test success, the next is to configure Nginx,? Nginx itself does not support PHP only by loading the PHP request to the PHP.

unzip the downloaded nginx-0.8.54.zip under D:/nginx to open the/conf/nginx.conf configuration inside server {

        Listen       8888;//port        server_name  localhost;        CharSet utf8;//Character Set location        ~ \.php$ {            root           html;//Project storage directory            Fastcgi_pass   127.0.0.1:9000;// Listening to Php-cgi.exe ports is important            Fastcgi_index  index.php;fastcgi_param script_filename       $document _root$fastcgi _script_name;   Loading CGI mode is important            include        fastcgi_params;        }}   

After configuring the start Nginx.exe in the browser view appears welcome page, here is just a successful step,

Nginx start and stop more trouble, can build two bat files

Star.bat path to correct @echo Offecho starting nginx...d:/nginx/nginx.exe//shartdown.bat @echo Offecho stopping nginx ... taskkill/f/im nginx.exe > Nulecho stopping PHP fastcgi...taskkill/f/im php-cgi.exe > Nulexit
?

two then configure PHP.ini to enable PHP to support the CGI mode, so that you can interact with Nginx,

First comment out; doc_root=, probably in line479.

Then open: Enable_dl = on about line 491

? cgi.force_redirect = 0

? cgi.fix_pathinfo=1

? fastcgi.impersonate = 1;

Cgi.rfc2616_headers = 1

Three last to start php-cgi.exe under the command line

?

D:\php>php-cgi.exe-b 1270.0.01:9000-q The port here is the same as the monitoring port configured in Nginx.

?

?

?

?

  • 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.