关于bluehost空间上wordpress后台变为英文的解决方案
“在64位空间上安装wordpress会出不汉化的情况”,这是Wordpress的自身bug,问题的出在是Wordpress在64位的CPU下(linux)运行时,由于PHP-gettext解析.mo语言文件文件出现错误,以导致Wordpress在使用中文版本时失败,并不是传说中的bluehost禁用了.mo格式文件.官方尚未出新的升级版本,我们可以通过修改\wordpress\wp-includes\gettext.php这个文件代码来实现.
根据wordpress版本不同,有两套方案:
1/ wordpress 2.3.2版本
查找这段代码
代码如下:
if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
$this->BYTEORDER = 0;
} elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
$this->BYTEORDER = 1;
} else {
$this->error = 1; // not MO file
return false;
}
替换成
if ($magic == ($MAGIC1 & 0xFFFFFFFF) || ($magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
$this->BYTEORDER = 0;
} elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
$this->BYTEORDER = 1;
} else {
$this->BYTEORDER = 0;
//$this->error = 1; // not MO file
//return false;
}
2/ wordpress 2.3.2之前的版本
查找这段代码
if ($magic == ($MAGIC1 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
$this->BYTEORDER = 0;
} elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
替换为
if ($magic == $MAGIC1) {
$this->BYTEORDER = 0;
} elseif ($magic == $MAGIC2) {
这样重新刷新后台页面,问题即可解决,如果还是看不到中文,抱歉,偶也没有其他办法啦.