Please help – Cannot create new posts of any type on production but everything works fine locally.

[ad_1]

I have a really strange situation with my website that I cannot seem to fix no matter what i do.

I’m getting the below error message when I try and create a post of any type (page, post or custom post type).

>There has been a critical error on this website. Please check your site admin email inbox for instructions.

Despite the message, I don’t actually get an email with further info. However, if I turn on WP\_DEBUG mode in my config.php file then I get the following `Fatal error` message (amongst a load of `Warning` and `Deprecated` messages).

>Fatal error: Uncaught Error: Attempt to assign property “post\_content” on null in /wp-admin/includes/post.php:748 Stack trace: #0 /wp-admin/post-new.php(66): get\_default\_post\_to\_edit() #1 {main} thrown in /wp-admin/includes/post.php on line 748

What’s really strange is that I maintain a local version of the site for development and I don’t see that issue at all on the local copy. However, as soon as I move the files and database to the production server I’m unable to create new posts.

Obviously, this would seem to point to some kind of issue with my hosting (or database, maybe?) but if I create a dev subdomain of my main domain and deploy the site there (on the exact same hosting) then everything works fine. I’ve checked PHP settings between local and live sites and made sure they are identical (using version 8.1.13).

I ‘m running version 6.1.1 of WordPress and have tried reinstalling WP core but still get the same error. Even with all plugins disabled and TwentyTwenty theme activated I am still unable to create any posts. At this point am at a bit of a loss as to what to try next.

Has anyone seen anything like this before or have any idea what I can try next?

Thanks in advance for any help.

[ad_2]
1 Comment
  1. The error message suggests that there may be an issue with the post_content field in your database. You could try using a tool like phpMyAdmin to inspect the wp_posts table in your database and see if there are any missing or null values in the post_content field.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer