Configuring Wnmp,windows Configuration under Windows wnmp_php Tutorial

Source: Internet
Author: User
Tags mysql download

Configure Wnmp,windows configuration under Windows Wnmp


Recently try to configure Nginx+php+mysql under Windows and summarize here.

1, download the Windows version of Nginx, the official website download address: http://nginx.org/en/download.htm, download good after decompression to D:\WNMP

2. Configure PHP

Download the Windows version of PHP, official website Download address: http://windows.php.net/download/,php will run as CGI, unzip the downloaded PHP package, to the D-disk Wnmp directory (D:\WNMP), Here, rename the extracted folder to PHP5.

Go to Folder to modify the Php.ini-development file to php.ini.

Open PHP.ini and find the following code

Extension_dir ="./ext" changes to Extension_dir ="d:/wnmp/php5/ext".  
; Extension=php_mysql.dll Remove the semicolon
; Extension=php_mysqli.dll Remove semicolons (Open database dynamic link library)

Then copy the Libmysql.dll file from the PHP5 directory to the C:\Windows directory, or set the environment variable path, and find the following code

; cgi.fix_pathinfo=0 remove the semicolon and change to cgi.fix_pathinfo=1

3. Configure Nginx

After unpacking, open the nginx.conf file in the Conf directory to find

Location/{root HTML;        Index index.html index.htm; } #error_page404/404. html; # REDIRECT Server error pages to theStaticPage/50x.html # Error_page - 502 503 504/50x.html; Location= /50x.html {root html; } # Proxy The PHP scripts to Apache listening on127.0.0.1: the# #location~\.php$ {# Proxy_pass http://127.0.0.1;#} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000# #location~\.php$ {# root HTML; # Fastcgi_pass127.0.0.1:9000;        # Fastcgi_index index.php; # Fastcgi_param Script_filename/Scripts$fastcgi_script_name;        # include Fastcgi_params; #}

Switch

Location/{root d:/www;        Set your own directory index index.html index.htm; } error_page404/404. html; Redirect Server error pages to theStaticPage/50x.html # Error_page - 502 503 504/50x.html; Location= /50x.html {root d:/www; } proxy the PHP scripts to Apache listening on127.0.0.1: the Location~\.php$ {proxy_pass http://127.0.0.1;} pass the PHP scripts to FastCGI server listening on127.0.0.1:9000 Location~\.php$ {root d:/www; Fastcgi_pass127.0.0.1:9000;            Fastcgi_index index.php; Fastcgi_param script_filename $document _root $fastcgi _script_name;        Include Fastcgi_params; }

Save the configuration file.

4. Running Nginx and PHP

Enter the command:

127.0. 0.1:9000 -C D:/wnmp/php5/php.ini

Run PHP in CGI to listen for nginx data sent from Port 9000. Double-click Nginx.exe to run Nginx.

Quick Launch settings: First download RunHiddenConsole.exe this file into the Nginx directory, and then save the following code as Start_nginx.bat

@echo off   set php_home=. /php5/set nginx_home=./echo starting PHP FastCGI ...   127.0. 0.1:9000 -c%php_home%/php.ini  echo  starting Nginx ... %nginx_home%/nginx.exe-p%nginx_home%Exit

Save the following code as Stop_nginx.bat

@echo off  echo stopping Nginx     ... /f/im nginx.exe > nul  echo stopping PHP FastCGI ...   /f/im php-cgi.exe > nul  exit

The final file is this, double-click Start_nginx.bat can start Nginx and PHP.

5, install the configuration MySQL download mysql:http://dev.mysql.com/downloads/mysql/, and then extract to the D:/MNMP directory in My-default.ini found
basedir=  Remove #(MySQL directory)
DataDir=c:\program files\mysql\data Remove # (MySQL directory \data)

Command line Entry directory: CD C:\Program Files\mysql\bin, enter the following command to install the Mysql:mysqld-install (can be found in the service after installation)

Start the service: net start MySQL, close service: net stop MySQL. It can also be started or shut down in the service.

Add the PATH variable: Add in the Settings > environment variable in Computer > Properties > Advanced system: F:\phpenv\mysql\bin Login command: mysql-h host ip-u user name-p user Password

http://www.bkjia.com/PHPjc/1126846.html www.bkjia.com true http://www.bkjia.com/PHPjc/1126846.html techarticle under Windows configuration wnmp,windows configuration Wnmp recently tried to configure Nginx+php+mysql under Windows, here is a summary. 1, download the Windows version of Nginx, official website download address: Http://ngi ...

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