【发布时间】:2023-01-19 16:47:02
【问题描述】:
我最近将我的网站迁移到新的 AWS ec2 linux 实例。 Php8.0、MySql8.0,所有页面都正常。 Wordpress数据库从Mysql5.7导出,导入到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 中的错误,页面将进入无限循环并最终显示“网关超时”。
【问题讨论】:
-
您的 mu 插件可能是原因...阅读错误。
-
感谢您的回复。 mu 插件文件夹中只有一个插件'endurance page cache plugin'。我重命名了文件夹并检查,来自耐力缓存插件的那 2 个错误消失了,但所有其他错误仍然存在。看起来像变量初始化问题,因为 mysql8.0 。不确定 Wordpress 5.9.3 是否兼容 MySql8.0