WordPress添加新帖子显示此"Warning: Attempt to read property " post_type " on null in /var/www/html/blog/wp-i



我最近将我的网站迁移到新的AWS ec2 linux实例上。Php8.0, MySql8.0,所有页面工作正常。从Mysql5.7导出Wordpress数据库,并导入到MySql8.0。博客显示和Wordpress的其他部分工作得很好。但是当我点击"添加新帖子",我得到这些错误。Wordpress是最新的5.9.3.


Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/post.php on line 7589
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/post.php on line 7590
Warning: Attempt to read property "ID" on null in /var/www/html/blog/wp-includes/post.php on line 7594
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/post.php on line 7837
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/theme.php on line 3502
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-content/mu-plugins/endurance-page-cache.php on line 544
Warning: Attempt to read property "public" on null in /var/www/html/blog/wp-content/mu-plugins/endurance-page-cache.php on line 544
Warning: Attempt to read property "ID" on null in /var/www/html/blog/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-sync/src/modules/class-posts.php on line 557
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/theme.php on line 3727
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/post.php on line 5375
Warning: Attempt to read property "ID" on null in /var/www/html/blog/wp-includes/post.php on line 5375
Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/post.php on line 4676
Fatal error: Uncaught Error: Attempt to assign property "post_content" on null in /var/www/html/blog/wp-admin/includes/post.php:742 Stack trace: #0 /var/www/html/blog/wp-admin/post-new.php(66): get_default_post_to_edit('post', true) #1 {main} thrown in /var/www/html/blog/wp-admin/includes/post.php on line 742

如果我禁用my.conf中的错误,页面会进入一个无限循环,最后显示'Gateway Timeout'。

我完全从服务器上删除了WordPress,并使用WPEngine Plugin将我的WordPress网站迁移到新的托管服务器上。幸运的是,我仍然可以访问旧服务器和网站文件,所以我可以这样做。一切都很好。

我认为这是PHP版本问题。尝试切换到PHP 7.4

最新更新