搭建wordpress开发环境
安装php
PHP下载地址:http://windows.php.net/download/
和MySQL一样,下载包是一个zip压缩包,只需解压缩即可。将它解压缩到 D:\WNMP\php-5.5.6-Win32-VC11-x64目录下:
配置php
将php.ini-production文件复制并重命名为php.ini,并用Notepad++(没有安装此软件的话就使用记事本)打开php.ini:
查找并定位到行 | 修改为 |
---|---|
; extension_dir = “ext” | extension_dir = “ext” |
;extension=php_gd2.dll | extension=php_gd2.dll |
;extension=php_mbstring.dll | extension=php_mbstring.dll |
;extension=php_mysql.dll | extension=php_mysql.dll |
;extension=php_mysqli.dll | extension=php_mysqli.dll |
;extension=php_pdo_mysql.dll | extension=php_pdo_mysql.dll |
;cgi.force_redirect = 1 | cgi.force_redirect = 1 |
;cgi.fix_pathinfo=1 | cgi.fix_pathinfo=1 |
;cgi.rfc2616_headers = 0 | cgi.rfc2616_headers = 1 |
安装MySQL
请阅读我写的文章《在Windows7_x64下安装MySQL(zip压缩包)》
安装Nginx
Nginx下载地址:http://nginx.org/en/download.html
当前可以选择下载稳定版本1.4.3,或者选择最新版本1.5.6,本文选择下载最新版。与php和mysql一样,下载包是一个zip压缩包,将它解压缩到D:\WNMP\nginx-1.5.6目录下:
配置Nginx
Nginx的配置文件是在安装目录的conf文件夹下的nginx.conf,并用Notepad++(没有安装此软件的话就使用记事本)打开它:
查找并定位到以下配置:
1
2 3 4 |
location / {
root html; index index.html index.htm; } |
修改为:
1
2 3 4 |
location / {
root html; index index.html index.htm index.php; } |
继续往下查找并定位到以下配置:
1
2 3 4 5 6 7 |
#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; #} |
将#号去掉,并改为:
1
2 3 4 5 6 7 |
location ~ \.php$ {
root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } |
在Nginx的根目录下
创建php-cgi-start.vbs文件,添加以下内容:
1
|
createobject("wscript.shell").run "D:\WNMP\php-5.5.6-Win32-VC11-x64\php-cgi.exe -b 127.0.0.1:9000 -c D:\WNMP\php-5.5.6-Win32-VC11-x64\php.ini",
|
创建nginx-start.vbs文件,添加以下内容:
1
|
createobject("wscript.shell").run "D:\WNMP\nginx-1.5.6\nginx.exe",0
|
创建service-start.bat文件用于启动web服务器,添加以下内容:
1
2 3 4 5 6 |
echo off;
php-cgi-start.vbs echo php-cgi started. Nginx-start.vbs echo nginx started. exit; |
创建service-stop.bat文件用于关闭web服务器,添加以下内容:
1
2 3 4 5 6 |
echo off
echo Stopping nginx... taskkill /F /IM nginx.exe > nul echo Stopping PHP FastCGI... taskkill /F /IM php-cgi.exe > nul exit |
以后只需用鼠标双击service-start.bat启动web服务,运行service-stop.bat关闭web服务。
配置完成后Nginx的安装根目录如下:
安装wordpress
将wordpress压缩包解压到D:\WNMP\nginx-1.5.6\html\目录下(这个目录是我们已配置的nginx默认根目录),并将文件夹重命名为wp,如下:
连接mysql数据库创建一个由wordpress专用的数据库:
C:\Windows\System32>mysql -h localhost -u root -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.25-log MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec) mysql> create user wp_admin@localhost identified by '123456';
Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on wordpress.* to wp_admin;
Query OK, 0 rows affected (0.00 sec)
在浏览器访问:http://localhost/wp即可访问wordpress安装页面(注意:nginx已启动)
创建配置文件
现在就开始
提交
进行安装
接下去就跟普通的网上注册一样简单了。
搭建wordpress开发环境的更多相关文章
- Ubuntu 搭建PHP开发环境
Ubuntu确实很好玩.有喜欢的命令行,简洁的界面,不同于Window要的感觉.偶尔换换环境工作,学习Linux的思维方式,是一种不错的做 法.之前也折腾过Ubuntu,不过,因为网络的问题,一直没有 ...
- 自定义搭建PHP开发环境
学习了一段时间php了,因为之前是刚接触php,所以用的是集成安装包(wamp).现在想进一步了解apache.mysql.php之间的关系以及提升自己所以进行自定义搭建PHP开发环境.废话不多说,请 ...
- 使用virtualenv搭建python3开发环境
问题描述 环境: CentOS6.5 想在此环境下使用python3进行开发,但CentOS6.5默认的python环境是2.6.6版本. 之前的做法是直接从源码安装python3,替换掉现有的开发环 ...
- Windows下搭建PHP开发环境
PHP集成开发环境有很多,如XAMPP.AppServ......只要一键安装就把PHP环境给搭建好了.但这种安装方式不够灵活,软件的自由组合不方便,同时也不利于学习.所以我还是喜欢手工搭建PHP开发 ...
- 搭建Android开发环境附图详解+模拟器安装(JDK+Eclipse+SDK+ADT)
——搭建android开发环境的方式有多种,比如:JDK+Eclipse+SDK+ADT或者JDK+Eclipse+捆绑好的AndroidSDK或者Android Studio. Google 决定将 ...
- mac os 下搭建android开发环境
mac os 下搭建android开发环境 周银辉 mac os 下搭建android环境比较方便, 如下几个步骤: 1,安装jdk 先搞清楚自己是否已经安装,在命令行下:java -version, ...
- mac 下 用 glfw3 搭建opengl开发环境
mac 下 用 glfw3 搭建opengl开发环境 下载编译 glfw3 Build Setting 里面, Library Search Paths -> 设置好编译 glfw 库的路径 H ...
- 在Eclipse下搭建Android开发环境教程
我们昨天向各位介绍了<在NetBeans上搭建Android SDK环境>,前不久也介绍过<在MyEclipse 8.6上搭建Android开发环境>, 都受到了读者的欢迎.但 ...
- 第二章 搭建Android开发环境
这一章为我们讲解了如何搭建Android开发环境. 首先要了解的是Android底层开发需要哪些工具:搭建android应用程序开发环境.android NDK开发环境和交叉编译环境,前两个用来测试L ...
随机推荐
- Oracle 数据整理
/* 大数据这块用到了 Oracle ... 记录一下. */ SELECT ssn,password FROM (Select ROWNUM AS ROWNO, T.* from ACCOUNT T ...
- 调用百度地图API的应用混淆后出问题
1 混淆后出问题,程序异常退出 在proguard-project.txt中添加 -libraryjars libs/BaiduLBS_Android.jar -keep class com.baid ...
- 获取Spring容器中的Bean
摘要 SpringMVC框架开发中可能会在Filter或Servlet中用到spring容器中注册的java bean 对象,获得容器中的java bean对象有如下方法 Spring中的Applic ...
- ubuntu 挂载windows共享目录的方法
建立windows共享目录 右击要共享的文件夹-->属性-->高级共享-->添加用户-->添加完全控制权限 假设建立的共享地址为\\192.168.1.100\Linux 获取 ...
- Docker上运行dotnet core
下载microsoft/dotnet镜像 运行命令: docker pull microsoft/dotnet 如果没有使用阿里镜像加速的,参照这篇先配置好再跑上面命令: http://www.cnb ...
- ORACLE rowid切分大表
通过如下sql获取rowid切分范围 ) || dbms_rowid.rowid_create(, DOI, lo_fno, lo_block, ) ) || ) || dbms_rowid.rowi ...
- python第十二天-----RabbitMQ
有一位小伙伴说让我去A站写博客可能会有很多人喜欢,真是搞不懂,北方哪里有卖萌?北方默认状态就是这么萌的!再者说了,这明明就是很专注于技术的博客嘛,能不能严肃点!知不知道什么叫帧? 学习到了数据库的相关 ...
- 修改myeclipse的servlet模板
今天修改myeclipse的servlet模板时,发生 Could not create the view: An unexpected exception was thrown.错误. 解决方案:1 ...
- 前端开发必备! 20 个强大的 Sublime Text 插件
http://www.oschina.net/translate/20-powerful-sublimetext-plugins http://www.w3cplus.com/tools/emmet- ...
- SQL获取所有数据库名、表名、储存过程以及参数列表
SQL获取所有数据库名.表名.储存过程以及参数列表 1.获取所有用户名:SELECT name FROM Sysusers where status='2' and islogin='1'islogi ...