Win platform installation configuration Nginx+php+mysql environment, Nginxmysql
1. Preparatory work
(1) PHP version 5.6.17 download address PHP website help home Download address
(2) Nginx version 1.8.0 download address Nginx website to help guests home download address
(3) MySQL version 5.7.10 MySQL official home download address
Installation and configuration of 2.php
Directly unzip the downloaded PHP package, to the D disk Wnmp directory (D:\WNMP), here the extracted folder renamed to PHP5. Go to Folder to modify the Php.ini-delelopment file to PHP.ini, and open it with EditPlus or notepad++. Found it
Extension_dir = "ext" changed to Extension_dir = "D:/wnmp/php5/ext"
Common extension, remove the front ";"
Extension=php_curl.dll Extension=php_gd2.dll Extension=php_mbstring.dll Extension=php_mcrypt.dll extension=php_ Mysql.dll Extension=php_mysqli.dll Extension=php_pdo.dll Extension=php_pdo_mysql.dll Extension=php_xmlrpc.dll
Nginx support configuration, remove the front ";"
; cgi.fix_pathinfo=1
; cgi.force_redirect = 1
; cgi.rfc2616_headers = 0 first go to the front semicolon and change to Cgi.rfc2616_headers = 1
Installation configuration for 3.Nginx
Unzip the downloaded package to D:\WNMP and run the directory directly under Nginx.exe boot.
1. There are 3 ways to start
(1) Double-click the Nginx.exe icon, the Black window can be seen a flash, the start is complete.
(2) command line to Nginx directory, input nginx boot. (Note that this way the command-line window has no hint and is locked)
(3) command line to Nginx directory, input start Nginx boot, this mode does not lock
2. Modify the configuration to support PHP
Enter the Nginx conf directory, open the Nginx configuration file nginx.conf, find
Location/{ root html; #这里是站点的根目录 index index.html index.htm index.php; }
The root HTML will be changed to root d:/wnmp/www;
Go down and find
# Pass the PHP scripts to FastCGI serverlistening on 127.0.0.1:9000 # #location ~ \.php$ {# root html; # Fastcgi_pass 127.0.0.1:9000; # Fastcgi_index index.php; # Fastcgi_param Script_filename/scripts$fastcgi_script_name; # include fastcgi_params; #}
First the "#" is removed, the same root HTML, to root d:/wnmp/www;. Then the marked red/scripts changed to "$document _root", where the "$document _root" refers to the previous "root" refers to the site path, this is changed:
# Pass the PHP scripts to FastCGI serverlistening in 127.0.0.1:9000 # location ~ \.php$ { root d:/wnmp/ www; Fastcgi_pass 127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi_script_name; Include Fastcgi_params; }
Save the configuration file and you're ready.
Nginx+php the environment is initially configured, to run to see. We can enter a command
To start PHP, and manually start Nginx, of course, you can also use the script to implement.
First, the downloaded Runhiddenconsole.zip package is extracted into the Nginx directory, the role of RunHiddenConsole.exe is to automatically close the script after executing the command line script, and the process opened from the script is not closed. Then create the script, named "Start_nginx.bat".
@echooff
Invalid under Remwindows
REM Set php_fcgi_children=5
REM maximum number of requests processed per process, or set to Windows environment variable
setphp_fcgi_max_requests=1000
Echo Starting phpfastcgi ...
Runhiddenconsole D:/wnmp/php5/php-cgi.exe-b 127.0.0.1:9000-cd:/wnmp/php5/php.ini
Echo Starting Nginx ...
Runhiddenconsole d:/wnmp/nginx/nginx.exe-p D:/wnmp/nginx
Create another script named Stop_nginx.bat to close Nginx
@echooffecho stoppingnginx taskkill/f/im nginx.exe > Nulecho stopping phpfastcgi...taskkill/f/im php-cgi.exe ; Nulexit
In this way, our service scripts have been created. Double-click Start_nginx.bat to see if the process manager has two nginx.exe processes and a php-cgi.exe process?
This will start the Nginx service, and PHP will run in a fastcgi manner.
To the Site directory, create a new phpinfo.php file, edit it inside
<?php echo phpinfo ();? >
After saving, open the browser input "http://localhost/phpinfo.php", if you see
It shows that the nginx+php environment has been configured, hehe ~
4.MySQL Installation and Configuration
(abbreviated) MySQL installation after download, all the way next install.
Articles you may be interested in:
- Nginx+php+mysql dual-machine interoperability, fully automatic switching scheme
- Nginx 0.7.x + PHP 5.2.6 (FastCGI) + MySQL 5.1 configuration optimization on the 128M Small memory VPS Server
- Windows uses Nginx to implement Web site load Balancing test instances
- How to install and configure Windows NGINX+PHP5
- Centos+nginx+php+mysql detailed configuration (plot)
- Nginx+windows Load Balancing Configuration method
- Linux (centos5.5)/windows open phpinfo Mode function configuration method sharing
- CentOS 6.4 Installation Configuration Lnmp server (nginx+php+mysql)
- Windows installation Nginx Deployment step diagram (reverse proxy vs. Load balancer)
http://www.bkjia.com/PHPjc/1091102.html www.bkjia.com true http://www.bkjia.com/PHPjc/1091102.html techarticle win Platform Installation configuration Nginx+php+mysql environment, Nginxmysql 1. Ready to Work (1) PHP version 5.6.17 download address PHP website to help home download address (2) Nginx version 1.8.0 download address Nginx official ...