Looking for web server ownership process
Try running
ps aux | grep php
to see which user owns the PHP process. $ ps aux | grep php root 1249 0.0 0.1 290648 5956 ? Ss Sep17 0:01 php-fpm: master process (/etc/php/php-fpm.conf) http 1278 0.0 1.0 374340 39492 ? S Sep17 0:21 php-fpm: pool www http 1279 0.0 1.1 374808 41460 ? S Sep17 0:12 php-fpm: pool www http 3934 0.0 1.0 374852 38048 ? S Sep17 0:17 php-fpm: pool www
It tells that the PHP process is running under the user http.
So, a quick solution will be to issue this command and give user recursive ownership of the whole WordPress installation
So, a quick solution will be to issue this command and give user recursive ownership of the whole WordPress installation
$ sudo chown -hR http:http PATH_TO_YOUR_WORDPRESS_FOLDER
Replacing
Notes: If you are using Ubuntu. The default user and group of your PHP and Web Server software is
http
with whatever user is yours.Notes: If you are using Ubuntu. The default user and group of your PHP and Web Server software is
www-data
.
Add below line at the bottom of wp-config.php and you are done!
define('FS_METHOD','direct');
If you continue to have errors, try to change the permissions for the wp-content and plugins folders:
sudo chmod 777 Your_wordpress_root_folder/wp-content
sudo chmod 777 Your_wordpress_root_folder/wp-content/plugins
sudo chmod 777 Your_wordpress_root_folder/wp-content
sudo chmod 777 Your_wordpress_root_folder/wp-content/plugins
I had the same problem and found the solution here
ReplyDeletehttp://rooturaj.com/technology/unable-to-create-directory-wordpress/
Its not always about chmod. Sometimes you might need to change the media file path, especially if you are shifting servers.