win7+nginx+php Preparation

Source: Internet
Author: User
win7+nginx+php Construction

?

Operating system: Window7??? php5.4.17???? nginx1.5.2

?

? download

    • Download PHP, Address: http://www.php.net/downloads.php


    • First create a folder called "Wnmp" in the e-disk, and then unzip the PHP to the change file.

    • Download Nginx, Address: http://nginx.org/en/download.html



?

?

    • Create a folder named "Nginx" in the Wnmp folder and unzip the Nginx into the folder.

Configuration?

    • Go to the PHP folder and change "Php.ini-development" to PHP.ini
    • Open the php.ini file and modify the content
    • Extension_dir = "ext" Date.timezone = asia/chongqing
      ?

Because Nginx requires CGI PHP, you need to change a few things.

ENABLE_DL = Oncgi.force_redirect = 0cgi.fix_pathinfo=1fastcgi.impersonate = 1cgi.rfc2616_headers = 1

? To this point, the PHP configuration is over, then configure Nginx.

?

  • First start Nginx, with DOS into the Nginx path, use the command to start Nginx
  • Nginx-s Reload//restart Nginxnginx-s stop//Pause Nginx-s quit//exit Nginxstart Nginx//start
    ? then enter 127.0.0.1 in the address bar of the browser to see the interface, indicating that Nginx is booting normally

  • The default access for Nginx is the index.php file under E:\wnmp\nginx\html\index.html.
  • Modify the nginx.conf (E:\wnmp\nginx\conf\nginx.conf) file to configure the site
  • Events {    worker_connections  1024;} HTTP {    include       mime.types;    Default_type  Application/octet-stream;    Sendfile on        ;    Keepalive_timeout  ;    server {    listen  ;    server_name  localhost; #本地IP    root   e:/wnmp/www; #存放网站的根目录 location    /{            index  index.php index.html index.htm; #添加index. php.            #autoindex on; #如果文件不存在列出目录结构;        }         Location ~ \.php$ {            fastcgi_pass   127.0.0.1:9000; #fastcgi及监听的端口与php的cgi启动时要一致            Fastcgi_index  index.php;            Fastcgi_param  script_filename  $document _root$fastcgi_script_name;            Include        Fastcgi_params;}}}    
    ?
    ? So the configuration is complete.

?

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