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

[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啦

One Response to “关于WP安装错误:Strict Standards: Declaration of Walker_Page”

  1. vb2005xu says:

    error_reporting(E_ALL & ~(E_STRICT | E_NOTICE));

    使用这一行解决

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

    请支持我开发的PHP框架: xser php framework

Leave a Reply