This article 20% is original, another reference here 78963025 Author: CSDN Gouyou Lan Feng
And here https://www.cnblogs.com/niuniutry/p/3555778.html Author: Blog Park tribute to the master
1. Download the above 3 software, here I use PHP version is Nonthreadsafe version, MySQL is Community Server version, note download Win64 bit of
2. Related software folder location processing
① Create Phpenvironment folder, enter d:\phpenvironment-> to create Wwwroot folder in D disk
② enter d:\phpenvironment\php-> to create Session folder (Session save path)
③ Enter d:\phpenvironment\php-> create upload folder (upload file save path)
To form such a structure:
3. Open D:\PHPEnvironment\nginx\conf\nginx.conf
Make the first change
There is the following code between approximately 43-45 rows:
Location/ { root html; Index index. html index.htm;}
Modify it to:
Location/ { root "D:/environment/wwwroot"; Index index. HTML index.htm Index. php; }
Make a second change
In approximately 63 lines-71 lines There is the following code:
# Pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000# #location ~ \.php$ {# root &NB sp;html;# fastcgi_pass 127.0.0.1:9000;# fastcgi _index index.php;# fastcgi_param script_filename / scripts$fastcgi_script_name;# include fastcgi_params;#} Modify it to: # Pass the PHP scripts to fastcgi server listening on 127.0.0.1:9000#location ~ \.php$ { &N Bsp root "D:/phpenvironment/wwwroot"; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param script_filename $document _ root$fastcgi_script_name; Include fastcgi_params;}
Here nginx.conf is configured well, we double hit open D:\PHPEnvironment\nginx\nginx.exe, open browser input localhost, if appear welcome to Nginx indicates Nginx configuration OK, Then we open the Task Manager and turn off the Nginx two processes.
4. Rename the D:\PHPEnvironment\php\php.ini-development to PHP.ini, and then make the following modifications.
Make the first change:
Find 734 lines with the following code:
; extension_dir = "./ext"
Modify it to:
Extension_dir = "D:\PHPEnvironment\php\ext"
Make a second change:
Find 744 lines with the following code:
ENABLE_DL = Off
Modify it to:
ENABLE_DL = On
Make a third change:
Find 751 lines with the following code:
; cgi.force_redirect = 1
Modify it to:
Cgi.force_redirect = 0
Make a fourth revision:
Find 771 lines with the following code:
; cgi.fix_pathinfo=1
Modify it to:
Cgi.fix_pathinfo=1
Make a fifth revision:
Find 784 lines with the following code:
; fastcgi.impersonate = 1
Modify it to:
Fastcgi.impersonate = 1
Make a sixth revision:
Find 796 lines with the following code:
; cgi.rfc2616_headers = 0
Modify it to:
Cgi.rfc2616_headers = 1
Make a seventh revision:
Find 936 lines with the following code:
; Date. TimeZone =
Modify it to:
Date. TimeZone = Asia/shanghai
Make a eighth revision:
Find 1445 lines with the following code:
; Session.save_path = "/tmp"
Modify it to:
; Session.save_path = "D:\PHPEnvironment\php\session"
Make a Nineth revision:
Let's go back to line 821 and find the following code:
; Upload_tmp_dir =
Modify it to:
Upload_tmp_dir = "D:\PHPEnvironment\php\upload"
Make a tenth change: we open up some PHP extensions according to our own needs, starting with 888 lines, and removing the semicolon in front of ": Extension=xxxxxxxxxxxxxxxxxx" to open the extension.
Here I have opened the following extensions:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_openssl.dll
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_snmp.dll
extension=php_sockets.dll
extension=php_sqlite.dll
extension=php_xsl.dll
Then we open the lower left corner Start menu->windows, right-click Command prompt, run as Administrator
Then enter the following command:
The first step is to enter D: Jump to the D drive (no double quotes here)
Step two Enter CD phpenvironment\php
The third step is to enter PHP-CGI. EXE -b 127.0. 0.1:9000 -C "D:/phpenvironment/php/php.ini" (yes, you're not mistaken, it's a slash)
Then we open the Task Manager and see the cgi/fastcgi process, which represents the start-up success, such as
Then we go into the D:\PHPEnvironment\wwwroot, create a file, named phpinfo.php, and write the following code:
<? PHP Phpinfo ();
Go to D:\PHPEnvironment\nginx, open nginx.exe. Then open the browser, enter localhost/phpinfo.php
OK, everything is fine. Then close the CGI and Nginx 3 processes.
Also need to add PHP environment variable right click on the desktop this computer-properties--Advanced system settings, advanced-environment variable--see path in System variables, click Edit--New->d:\phpenvironment\ Php
We then open a command prompt to enter php-v, and if the version information appears, add the environment variable that successfully added PHP
5. Create a startup script for Nginx and PHP
Download Runhiddenconsole.zip link from here: https://pan.baidu.com/s/1bCvBkW-qlIb8FhSWJCHppw Password: k7eb
① the downloaded runhiddenconsole.zip to the Nginx directory, the creation script named "Start_nginx.bat", used to launch Nginx and phpcgi, open the bat file with a text editor, write into the following code:
You're not mistaken, it's all written in backslashes.
@echo offrem windows under invalid REM set Php_fcgi_children=5rem per process the maximum number of requests processed, or set to Windows environment variable set php_fcgi _max_requests=1000echo starting PHP FastCGI ... runhiddenconsole D: \phpenvironment\php\php-cgi.exe-b 127.0.0.1:9000-c D:\PHPEnvironment\php\php. INI Echo Starting Nginx ... runhiddenconsole D: \phpenvironment\nginx\nginx.exe-p D:/phpenvironment/nginx
② Create Stop_nginx.bat script close Nginx and phpcgi, write into the following code
@Echo offecho stopping nginx ... /f/im nginx.exe > nulecho stopping PHP FastCGI ... /f/im php-cgi.exe > nulexit
Test the script OK, go to the next step.
6. Install MySQL:
The beginning of this is that MySQL is a free-to-install version, so just a few simple steps can be put into use.
① first create the environment variables of MySQL, or follow the above method of PHP creation, as long as the path is written as D:\PHPEnvironment\mysql\bin OK, open a command prompt, enter mysql-v (V capital), OK appears version information, the next step.
② By default, there is no My.ini file, which requires us to create one manually under the MySQL folder, do not move the other my.ini-suffix file, create a new My.ini directly and enter the following data
[Mysqld]
#绑定IPv4和3306端口
Bind-address = 0.0.0.0
Port = 3306
# set up the MySQL installation directory
Basedir=d:\phpenvironment\mysql
# Set up a storage directory for MySQL database data
Datadir=d:\phpenvironment\mysql/data
# Maximum number of connections allowed
max_connections=200
③ following the method above to open a command prompt as an administrator, enter Mysqld-install, prompt success, the installation is successful, the MySQL service can boot.
Now I feel the hard drive inside the teacher's call, everyone, first step.
win10.64 bit wnmp-nginx1.14.0 + PHP 5. 6.36 + MySQL 5.5.59 Environment Configuration Setup