windows 系统中wordpress安装配置教程

一 wordpress安装

我用的是XAMPP(Apache+MySql+PHP),wordpress(BLOG程序)3.5.1 简体中文官方安装版
,下面来说说Windows下用XAMPP安装wordpress的方法。

安装XAMPP就是傻瓜式的next、next。安装完成之后运行Control
Panel,启动Apache和Mysql,如下图

 

选择Mysql后面的Admin进入数据库管理界面,如下图

 

我们先建立数据库,随便命名,这个数据库作为wordpress安装时要用到的数据库。

下载wordpress,wordpress(BLOG程序)3.5.1 简体中文官方安装版
,解压后将得到的wordpress文件夹拷贝到XAMPP安装目录下的htdocs文件夹下。接下来浏览器中访问/localhost
/worpress,在出现的界面中点击Create a configuration File。在接下来的界面中输入数据库的名字(你一开始建立的),User
Name 填写root,Password
填空,点击submit。接下来设置网站标题,密码,邮箱等等。安装完成之后就可以用admin用户名和你刚才设置的密码进行后台登陆了。可以在后台常规设置中设置站点的地址。

如果想让局域网访问站点,需要对Apache进行配置,否则有可能无法显示图片等等,具体方法是点击面板中Apache后面的config,打开httpt.conf文件。在该文件中输入以下代码即可。

DocumentRoot D:/xampp/htdocs/wordpress(wordpress路径)

二 wordpress转移

首先用WordPress Database
Backup这个插件对wordpress进行备份,导出sql文件。为了方便在新的机器上建立同样名字的数据库,按照上面的步骤进行wordpress
的安装,接下来导入sql文件,并且拷贝原来的主题、插件等到新的wordpress文件夹中。由于域名的改变需要对数据库进行修改,主要是对wp-
options和wp-posts表进行修改。

在wp-options中运行如下sql语句

update wp_options set option_value=’新的地址’ where option_name=’siteurl’;

update wp_options set option_value=’新的地址’ where option_name=’home’;

update wp_posts set guid = replace(guid,’旧地址’,’新地址’);
在wp-posts中运行如下sql语句

update wp_posts set post_content=replace(post_content,’旧地址’,’新地址’);

update wp_posts set post_excerp= replace(post_excerpt,’旧地址’,’新地址’);

这样你的博客就成功迁移了。

三 wordpress一些细节

上传图片一般需要英文名字。

最大上传文件大小为2M,修改的话需要修改php.ini文件,post_max_size=800M memory_limit=800M
upload_max_filesize=800M,大小可以随你,并在wp-config.php文件中加一句
define(‘WP_MEMORY_LIMIT’,’800M’)。

修改模板的颜色大小等一般在css文件中。

如果图片,格式显示不正常,估计是没有配置apache。

卸载XAMPP时先停止服务,然后卸载服务,然后卸载XAMPP应用,这样下次安装一般不会出现什么问题。

先写这么多,以后遇到什么问题再补充。

4 Comments

  • garcinia cambogia scam

    2016年4月29日 at 下午11:26 回复

    Right here is the perfect website for everyone who hopes to understand this topic.
    You realize so much its almost tough to argue with you (not that I actually would want to…HaHa).
    You certainly put a fresh spin on a subject that’s been written about
    for many years. Excellent stuff, just excellent!

  • Freddy

    2016年4月30日 at 上午10:54 回复

    Undeniably consider that which you stated. Your favorite justification appeared to be on the
    net the easiest factor to consider of. I say to you, I certainly
    get annoyed at the same time as other people think about concerns that they just don’t
    realize about. You controlled to hit the nail upon the top and also defined out
    the whole thing without having side-effects ,
    other folks can take a signal. Will probably be again to get more.
    Thank you

  • Gayle

    2016年4月30日 at 下午1:38 回复

    If some one wants to be updated with latest technologies after that he must be pay a visit this web page and
    be up to date all the time.

  • featured garcinia cambogia

    2016年5月1日 at 上午12:46 回复

    Post writing is also a excitement, if you be familiar
    with then you can write if not it is complicated to write.

Post a Reply to Gayle Cancel Reply