目录
前言
本文的主要目的是帮助那些刚刚接触WordPress的网友在半个小时以内安装,配置一个简易的WordPress环境。这里假设我们的域名是 www.domain.com
下载安装包
-
下载Apache,PHP,MySQl整合安装包,下载地址:https://www.apachefriends.org/xampp-files/5.6.23/xampp-win32-5.6.23-0-VC11-installer.exe
-
下载WordPress中文版,下载地址:https://cn.wordpress.org/wordpress-4.5.3-zh_CN.zip
-
将Xampp包解压缩到d:\
-
在Xampp目录中新建.\www\domain.com\目录,把WordPress解压缩到这个目录中,现在我们的WordPress的路径为d:\Xampp\www\domain.com\WordPress
设置域名
编辑C:\WINDOWS\system32\drivers\etc\hosts文件,加入如下内容
127.0.0.1 www.domain.com
安装Apache,PHP,MySQl整合环境
建立虚拟主机,在Xampp目录下找到.\Xampp\apache\conf\extra\httpd-vhost.conf文件,在最后加入如下内容
<VirtualHost *:80>ServerAdmin [email protected]
ServerName www.domain.com ##您的域名
DirectoryIndex index.php index.htm index.html
DocumentRoot d:\xampp\www\domain.com\wordpress ##WordPress目录
<Directory />
AllowOverride All
Order allow,deny
Allow from all
</Directory>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
注:域名和目录部分根据您的具体情况更改
在Xampp目录中运行setup_xampp.bat安装脚本,安装Xampp包
在Xampp目录下运行xampp_start.exe文件,启动服务
创建数据库及用户
登录数据库,在“运行”里输入cmd,在Dos窗口中输入以下命令
D:\xampp\mysql\bin\mysql -u root -p
出现Enter Password: 提示,直接回车
创建数据库
create database www_domain_com;/
创建用户
grant all on www_domain_com.* to [email protected] identified by "password";
刷新权限
flush privileges;
安装WordPress
在浏览器中输入http://www.domain.com
根据WordPress的提示填入配置信息
数据库:www_domain_com
数据库用户名:username
数据库密码:password
数据库主机地址:localhost
数据表前缀:wp_
点击安装WordPress,填入Blog标题和您的邮件地址
完成安装,用笔记下您的帐号和密码,帐号是admin,密码是一个随机字符串
登录并修改密码好了,大功告成,欢迎您进入WordPress的世界。
All Done!