[PHP sharing] build a Windows local development environment 1. install Nginx + PHP
-
Download Nginx and install it to a specified directory, such as D: \ nginx-1.7.5.
-
Download PHP and install it in a specified directory, such as D: \ php. Note: in the Windows environment, the PHP binary includes the thread-safe version and the non-thread-safe version. select the corresponding version and install the extension package independently.
2. environment configuration
1). Nginx configuration:
# Nginx. confserver {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 500 502 503 504/50 x.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 the service script
# Start_service.bat @ echo offREM the maximum number of requests processed by each process, or set it to the Windows environment variable set PHP_FCGI_MAX_REQUESTS = 1000 echo Starting PHP FastCGI... runHiddenConsole D:/php/php-cgi.exe-B 127.0.0.1: 9000-c D:/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.exe> nulexit
Finally, double-click start_service.bat to start the corresponding service.
4. access localhost/index. php to view the home page.