尝试在我现有的网站上集成Wordpress时出错


Errors when trying to integrate Wordpress on my existing website

我遵循了Wordpress Codex的指南:将Wordpress与您的网站集成但我得到了以下错误:

Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'post-template.php Line 1071 ]
Declaration of Walker_Page::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'post-template.php Line 1071 ]
Declaration of Walker_Page::start_el() should be compatible with that of Walker::start_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'post-template.php Line 1071 ]
Declaration of Walker_Page::end_el() should be compatible with that of Walker::end_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'post-template.php Line 1071 ]
Declaration of Walker_PageDropdown::start_el() should be compatible with that of Walker::start_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'post-template.php Line 1116 ]
Declaration of Walker_Category::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'category-template.php Line 915 ]
Declaration of Walker_Category::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'category-template.php Line 915 ]
Declaration of Walker_Category::start_el() should be compatible with that of Walker::start_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'category-template.php Line 915 ]
Declaration of Walker_Category::end_el() should be compatible with that of Walker::end_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'category-template.php Line 915 ]
Declaration of Walker_CategoryDropdown::start_el() should be compatible with that of Walker::start_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'category-template.php Line 966 ]
Declaration of Walker_Comment::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'comment-template.php Line 1400 ]
Declaration of Walker_Comment::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'comment-template.php Line 1400 ]
Declaration of Walker_Comment::start_el() should be compatible with that of Walker::start_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'comment-template.php Line 1400 ]
Declaration of Walker_Comment::end_el() should be compatible with that of Walker::end_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'comment-template.php Line 1400 ]
Redefining already defined constructor for class WP_Widget [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'widgets.php Line 93 ]
Declaration of Walker_Nav_Menu::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'nav-menu-template.php Line 109 ]
Declaration of Walker_Nav_Menu::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'nav-menu-template.php Line 109 ]
Declaration of Walker_Nav_Menu::start_el() should be compatible with that of Walker::start_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'nav-menu-template.php Line 109 ]
Declaration of Walker_Nav_Menu::end_el() should be compatible with that of Walker::end_el() [ On E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'nav-menu-template.php Line 109 ]
Fatal error: Call to a member function add_rewrite_tag() on a non-object in E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'taxonomy.php on line 333

真是漏洞百出!我使用Wordpress v3.3.1和PHP v.3.1我的php.ini错误报告是error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT,但不确定error_reporting是否在代码中的某个地方被覆盖。

我浏览了一下Wordpress php文件,发现wp-includes/class-wp-walker.php中的函数参数不匹配问题,但我不想在不知道真正问题的情况下通过匹配参数来修复它。

你知道这里可能发生了什么吗?

非常感谢!

编辑:修复了所有声明错误,现在只剩下一个

Fatal error: Call to a member function add_rewrite_tag() on a non-object in E:'Documents'work'devenv'xampp'htdocs'orp'blog'wp-includes'taxonomy.php on line 334

似乎没有定义$wp_rewrite,其值为null。事实上,所有全局变量在wp-includes'taxonomy.php 中都不可用

许多错误("X的声明应该是兼容的")实际上是由php的E_STRICT触发的警告,不管怎样,它似乎都是启用的。

最后一个似乎是wordpress试图向其分类类加载一些值,该分类类处理URL重写和搜索引擎友好的URL,但失败或配置不正确。

好的,我把初始化代码移到了脚本的顶部。

<?php 
  /* Short and sweet */
  define('WP_USE_THEMES', false);
  require('./wp-blog-header.php');
?>

这就解决了!

感谢