将Wordpress网站从Linux移动到Windows会引发错误


Moving Wordpress site from Linux to Windows throws errors

我被要求将某人的博客从Linux服务器转移到Windows 2008盒子中。我在新盒子上用了Xampp。当我尝试访问博客时,我得到以下错误:

Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-settings.php on line 472
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-settings.php on line 487
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-settings.php on line 494
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-settings.php on line 530
Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 594
Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 594
Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 594
Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 594
Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 611
Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 705
Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 705
Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 705
Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 705
Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el(&$output) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'classes.php on line 728
Strict Standards: Redefining already defined constructor for class wpdb in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'wp-db.php on line 306
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'cache.php on line 103
Strict Standards: Redefining already defined constructor for class WP_Object_Cache in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'cache.php on line 425
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'query.php on line 21
Deprecated: Assigning the return value of new by reference is deprecated in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'theme.php on line 623
Strict Standards: Redefining already defined constructor for class WP_Dependencies in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'class.wp-dependencies.php on line 15
Warning: Creating default object from empty value in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'update.php on line 39
Warning: Cannot modify header information - headers already sent by (output started at C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'class.wp-dependencies.php:15) in C:'xampp'htdocs'newblogBlog'httpdocs'wp-includes'pluggable.php on line 770

有什么想法吗?

我认为linux服务器中的php.ini正在取消激活错误报告。

对于严格的标准,您可以通过从php.ini文件中的选项error_reporting中删除E_STRICT来隐藏它们(但修复它们可能更好)。

对于剩下的问题,我建议你解决它们,特别是警告。

还要检查linux中的PHP版本是否与windows中的相同,从一个版本迁移到另一个版本可能会导致这样的问题。

检查服务器和xammp框上使用的php版本。您可以通过创建包含单行的单个文件来实现这一点

<?php phpinfo(); ?>

这将为您提供使用过的版本。如果你可以在新旧系统上使用相同的版本,你可以得到更少的警告,也许。。。

如果仍然存在警告,您可以在php.ini中使用正确的条目将其过滤掉。

建议生产系统不要显示错误,有人可能会利用这些信息攻击你的系统。。。您可以更改Yazmat提到的显示错误的详细级别,或者关闭php.ini中错误的显示,如下所示:

display_errors = 0