Install Nginx + PHP under Windows

Source: Internet
Author: User

1. Download the Software

Required software is nginx,php,mysql (if not required)
Nginx.org,www.php.net on the top.
Unzip it all.
PHP basically do not have to make any changes (download the direct decompression version)

Use the cmd command in the Nginx directory to execute start Nginx.exe can start Nginx, notice whether 80 port is occupied, boot successfully run localhost in the browser can open the Nginx default page

  

However, it is not possible to run the PHP file yet, it needs to be configured to continue

2. Configure Nginx

In the nginx.conf file, locate the following commented code, modify the root to absolute path, and set Script_filename to replace with $document_root after

# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
Location ~ \.php$ {
Root e:/phptools/nginx-1.13.4/html;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root/$fastcgi _script_name;
Include Fastcgi_params;
}

3. Running the Software

The cmd command executes the start Php-cgi.exe-b 127.0.0.1:9000-c in the PHP installation directory php.ini

cmd command in the Nginx installation directory execution nginx.exe-s stop first the nginx process just started off, and then restart the start Nginx.exe

To this, Nginx + PHP configuration is complete. You can then install MySQL to develop it.

Reference: http://www.nginx.cn/doc/setup/nginx-windows.html

Install Nginx + PHP under Windows

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.