I recently migrated my website to new AWS ec2 linux instance. Php8.0, MySql8.0, all pages work fine. WordPress database was exported from Mysql5.7 and imported to MySql8.0. The blog display and other parts of WordPress works fine. But when I click ‘Add New Post’ I am getting these errors. WordPress is latest 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
If I disable the errors in my.conf the page goes into an endless loop and finally displays ‘Gateway Timeout’.
2
Answers
I completely removed WordPress from the server and used WPEngine Plugin to migrate my WordPress website to new hosting server. Luckily I still had access to the old server and by website files, so I could do this. Everything works just fine.
I think it is a PHP version issue. Try to switch to PHP 7.4