WordPress入门实践

WordPress是使用PHP语言开发的博客平台。

本文记录WordPress配合PHP、MySQL、Nginx在Windows下的安装配置。

1、下载、解压(或安装)

WordPress https://cn.wordpress.org
PHP http://windows.php.net/download
Nginx http://nginx.org/en/download.html
MySQL https://dev.mysql.com/downloads/mysql/

2、配置

2.1、MySQL

假设MySQL已经安装好并启动服务

2.2、WordPress

假设把WordPress解压到D盘

2.3、PHP

在php根目录下找到php.ini-development文件,复制一份在当前目录并且重命名为php.ini,在php.ini内容中分别找到以下3行,并去掉其前面的分号注释,保存。

;cgi.fix_pathinfo=1
;extension=php_mysqli.dll
;extension_dir = "ext"

以以下命令启动PHP:

php-cgi.exe -b 127.0.0.1:9000 -c php.ini
2.4、Nginx

更改配置文件conf/nginx.conf中的内容。

找到

        location / {
            root   html;
            index  index.html index.htm;
        }

修改为:

        location / {
            root   d:/wordpress;
            index  index.html index.htm index.php;
        }

找到

        #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;
        #}

修改为:

        location ~ \.php$ {
            root           d:/wordpress;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }

双击nginx.exe启动nginx。

3、完成

浏览器打开链接http://localhost/wp-admin/install.php

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值