[PHP sharing] build a Windows local development environment

Source: Internet
Author: User
[PHP sharing] build a Windows local development environment 1. install Nginx + PHP

  1. Download Nginx and install it to a specified directory, such as D: \ nginx-1.7.5.

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

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.