【问题标题】:Wordpress Add New Post shows this "Warning: Attempt to read property "post_type" on null in /var/www/html/blog/wp-includes/post.php on line 7589"Wordpress 添加新帖子显示此“警告:尝试在第 7589 行的 /var/www/html/blog/wp-includes/post.php 中读取 null 属性 \”post_type\””
【发布时间】: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

标签: linux wordpress


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 2015-10-08
      • 2020-08-01
      • 2017-05-30
      • 2017-07-13
      • 2018-09-27
      • 1970-01-01
      • 2016-11-27
      • 2017-08-21
      • 2022-08-14
      相关资源
      最近更新 更多