Site icon Hip-Hop Website Design and Development

Cannot create new posts or upload images using media manager

My WordPress website was recently moved from one a shared hosting provider to a VPS setup at Digital Ocean. I provisioned the server myself and have WordPress running on a LAMP stack with Linux Ubuntu 20. The website itself is working when viewed from the front-end, but it is experiencing issues when trying to add new posts or uploading media.

When I try to add a new post, the following warning is displayed below the title field: You are currently editing the page that shows your latest posts. The editor textarea and category blocks are missing, but ACF-related blocks and other plugin blocks like Yoast are still there. I have attached an image showing how it looks.

I have checked the file permissions and ownership of the directories and files, and they are set correctly. All directories and files are owned by the www-data user and group. The only directory and files that are owned by my SFTP user is the custom theme.

I have run sudo find /var/www/domain.ca/ -type d -exec chmod 755 {} ; and sudo find /var/www/domain.ca/ -type f -exec chmod 644 {} ;, but this has not resolved the issue.

I have added define (‘WP_ALLOW_REPAIR’, true); to the wp-config.php file and run the repair and optimize using http://domain.ca/wp-admin/maint/repair.php. All tables were listed as okay after completion.

I have tried enabling define( 'WP_DEBUG', true );, but only notices are displayed.

When I try to upload an image using the media manager, the following error is displayed in the Firefox dev console: POST http://domain.ca/wp-admin/async-upload.php [HTTP/1.1 403 Forbidden 399ms] The server has its file size upload settings set to 8MB for upload_max_filesize and 10MB for post_max_size.

I can successfully edit existing posts and update media data like titles.

I can successfully execute a backup using the UpdraftPlus backup plugin.

The Your homepage displays setting under Settings > Reading displays Your latest posts.

When I save any setting, no success message is displayed by WordPress.

WordPress 5.8.2
PHP 7.4.26

Any ideas on what is going wrong?

Cheers,