Deployment of nginx + wordpress running and debugging environment tutorial

Source: Internet
Author: User
Tags comments ini php windows windows download wordpress version

In the past, apache + wordpress was used when I was playing with wordpress. However, although I became an nginx fan, it was only used for nginx + python development and did not work with nginx + php. This time I tried to build a debugging environment for wordpress, so I reorganized it.

PS
PS2: This time it was done in windows. It is actually the same in linux.

OK, we are officially starting

I. Install and deploy php

Download the zip package on the php windows download page instead of the installation package
Decompress the package to D: programphp5.
Rename php. ini-production to php. ini.
Modify php. ini

Remove comments from the following code to support mysql

Extension = php_mysql.dll

Remove comments from the following code to specify the ext path

Extension_dir = "ext"

II. Install and deploy mysql

Go to http://www.mysql.com/downloads/mysql/download windows MySQL Community Server
Install and start the service (by default, it is started randomly, otherwise net start mysql)

III. Install and deploy nginx

Download the latest nginx at http://www.nginx.org/
Decompress the package to D: programnginx.
You can create three new batchcompute scripts. You can quickly download the nginxfile from the startup menu of windows and store it in the statistics directory of nginx.exe.

Start. bat

% ~ D0
    
Cd "% ~ Dp0"
Start nginx.exe

Stop. bat

% ~ D0
    
Cd "% ~ Dp0"
Start nginx.exe-s stop

Reloat. bat

% ~ D0
    
Cd "% ~ Dp0"
Start nginx.exe-s reload

IV. Install and deploy wordpress

To http://cn.wordpress.org/download the latest wordpress version
Decompress the package to D: wwwwp.
Create the following script in the D: wwwwp Directory:

Start. bat

D:/program/php5/php-cgi.exe-B 127.0.0.1: 1998-c D:/program/php5/php. ini

Set wscriptObj = CreateObject ("Wscript. Shell ")
WscriptObj. run "start. bat", 0

Among them, start. bat can start the fastcgi service, but there is a dos window. If start. vbs is used, the dos window can be hidden.

5. Configure nginx

Modify nginx. conf and create the server configuration as follows:

Server {
Listen 80;
Server_name wp.qq.com;
    
Root D:/www/wp;
    
Rewrite/wp-admin $ scheme: // $ host $ uri/permanent;
    
Location /{
Fastcgi_pass 127.0.0.1: 1998;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Include fastcgi_params;
        }
    
Location ~ *. (Js | css | png | jpg | jpeg | gif | ico) $ {
Expires max;
Log_not_found off;
        }
    }

The following two items may be different from what I set. You can modify them on your own.

Root D:/www/wp;
Fastcgi_pass 127.0.0.1: 1998;

For the following static configuration, you must configure it. Previously, debugging was conducted here for half a day ..

Location ~ *. (Js | css | png | jpg | jpeg | gif | ico) $ {
Expires max;
Log_not_found off;
    }

Restart nginx. OK!

OK. Visit 127.0.0.1 to see if the wordpress installation interface is displayed? Haha!

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.