1. nginx+php Installation
- Download Nginx, install to the specified directory, such as D:\nginx-1.7.5.
- Download PHP, install to the specified directory, such as D:\php. Note: PHP Binaries in the window environment include both thread-safe and non-thread-safe versions, and they need to be consistent when selecting the appropriate version to install independently of the expansion packs.
2. Environment configuration 1). Nginx Configuration:
# nginx.conf server {Listen 80; server_name localhost; Access_log Logs/localhost.access.log; Location/{root d:/localhost/trunk; Index index.html index.htm index.php; } error_page 502 503 504/50x.html; Location =/50x.html {root html; } location ~ \.php$ {root D:/localhost/trunk; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; }}
2). Configure the Local Host
127.0.0.1 localhost
3. Start/Stop service script
#start_service. bat @echo Offrem the maximum number of requests processed per process, or set to Windows environment variable set Php_fcgi_max_requests=1000echo starting PHP FastCGI ... Runhiddenconsole d:/php/php-cgi.exe-b 127.0.0.1:9000-c d:/php/php.ini echo starting nginx ... Runhiddenconsole d:/nginx-1.7.5/nginx.exe-p d:/nginx-1.7.5
#stop_service. Bat @echo Offecho stopping nginx...taskkill/f/im nginx.exe > Nulecho stopping PHP fastcgi...taskkill/f/im php-cgi.e Xe > Nulexit
Finally, double-click Start_service.bat to start the corresponding service.
4. Visit localhost/index.php to see the homepage
"PHP sharing" WNP Local development environment building