WP2.9.1安装错误:Can’t select database

January 28th, 2010

在PHP5.3和Apache2的环境下,WP2.9.1安装的时候依然出现2.8.4的安装错误:

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl() in \wordpress\wp-includes\classes.php on line 1214

解决办法请参考:

关于WP安装错误:Strict Standards: Declaration of Walker_Page

Nina Dobrev妮娜·杜波夫

January 22nd, 2010


关于WP安装错误:Strict Standards: Declaration of Walker_Page

September 16th, 2009

[PHP Version 5.3.0]新安装WP2.8.4有可能会出现下面的错误at wp-includes\classes.php on line 1214:

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl()

办法:建议使用PHP Version 5.2.6以下安装。
如果执意要安装,可以执行以下步骤:
在wp-includes\classes.php文件中:

1. 将所有 extends Walker { 替换成 {
注意:记得安装完后还原classes.php

2. wp-includes\class-simplepie.php中line 3520: function get_date($date_format = ‘j F Y, g:i a’)添加:

function get_date($date_format = ‘j F Y, g:i a’)
{
if(PHP_VERSION >= ’5.1.0′){
date_default_timezone_set(‘Asia/Hong_Kong’);
}

3. wp-includes\functions.php 中line 34: $i = strtotime( $m );添加:

if(PHP_VERSION >= ’5.1.0′){
date_default_timezone_set(‘Asia/Hong_Kong’);
}
$i = strtotime( $m );

4.只要有类似下面的错误:
Warning: strtotime()
Warning: date()
就添加
if(PHP_VERSION >= ’5.1.0′){
date_default_timezone_set(‘Asia/Hong_Kong’);
}
修改文件包括:
wp-admin/includes/template.php
wp-admin/options-general.php
wp-admin/edit-form-advanced.php
wp-admin/edit-page-form.php

这样可以继续享受最新版的WP啦