So, you too got the same error. No doubt WordPress is one of the most used Content management system that gives great experience to the user as well as it is much flexible. One can create any type of site using wordpress.
Some of the top 1000 sites on the internet are built on the WordPress Content management System. But, it has errors too! It is developed completely on PHP and Mysql and they need No errors and No warnings to work properly.
Moreover, they need Proper permissions to access/create/edit/delete files and folders on the server on which you are running it. And the problem We are getting is due to Permission and Ownership problems.
To work with wordpress, you need to have Apache and mysql and PHP installed on your server. And, the files you are having on your server should be owned by Apache… I mean it… I said Apache not root.
You are getting this error because Ownership of the wordpress files are not given to apache. To solve this error, Open up Putty if you are using Windows and Terminal if you are using Ubuntu or Mac OS X.
After that, connect with your server using command ssh root@your_ip in Ubuntu and Mac OS X and in Putty, you will be asked to enter password directly.
Enter the password and you will be logged in. Now Navigate to the folder in which you have wordpress installed. You have to navigate to that folder only. Don’t go inside folder containing wordpress files.
Once you are in, just enter the below given command according to your Operating System.
Ubuntu :
sudo chown www-data:www-data -R your_wordpress_directory
CentOS :
sudo chown apache:apache -R your_wordpress_directory
Now, Just update your wordpress to the latest version. If you have already updated, reinstall it or update any plugin or theme to check it once.
If you have all things updated, You can do that by going to URL www.domain.com/wp-admin/update-core.php . Go to that URL and Re install your WordPress.
If it is done properly, Your error is solved… Else try again. Have a great day. I hope you came to know about each and every thing written in this article. It is important to understand the concept instead just typing commands in terminal.