Sep 05
作者: 肖建彬 | 可以转载, 转载时务必以超链接形式标明文章原始出处和作者信息及版权声明
网址:http://www.xiaojb.com/archives/it/wordpress_install.shtml
网址:http://www.xiaojb.com/archives/it/wordpress_install.shtml
WordPress是一款强大的BLOG软件,使用PHP编写,有相当的用户群,请可以从这里下载。
首先下载并解压最新版本的WordPress
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz
cd wordpress
tar zxf latest.tar.gz
cd wordpress
进入wordpress目录后,将wp-config.sample.php改名为wp-config.php
mv wp-config.sample.php wp-config.php
编辑wp-config.php并修改数据库相关的参数
// ** MySQL settings ** //
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
数据库需要首先建好,使用4.1以上版本的需要注意字符集的问题,我选用的是UTF-8。
配置好apache,就可以从web上安装了。从http://yoursite.net/wp-admin/install.php开始安装WP,注意点下一步,随机生成的admin的密码要记住,然后按照提示登录。
我的站点中文不能正确显示,因为mysql默认的字符集不是utf-8,所以我编辑了wp-includes/wp-db.php,wpdb的函数中,选择数据库前增加了$this->query(”SET names ‘utf8′”);一行。这样就没问题了,如果还有问题,将数据库清掉,重新来。
汉化:
从WordPress中文站下载了一份中文版,把其中的zh_CN.mo拷贝到wp-includes/languages下,在修改wp-config.php,将
define (’WPLANG’, ”);改成define (’WPLANG’, ‘zh_CN’);即可。
Recent Comments