0

I have a website where the home page is created in CodeIgniter (www.myweb.com) and the blogs are created in WordPress as a subdirectory (blog.myweb.com) and is hosted in AWS. I am trying to update the plugins and WordPress core but after I give FTP credentials, the error is Unable to locate WordPress content directory (wp-content). What should I do.

I have tried setting the permission as per one of the thread here. But no luck.

I have gone through some documentation and tried defining the plugin directory to define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/blog/wp-content/plugins' ); but no luck here too.

Please advice to resolve the issue.

  • is this a multisite? Sounds like your have an ownership/permissions problem, the correct owner/group/permissions will depend on your server and how it was configured, I would avoid the FTP path for now and focus on getting it to write directly – Tom J Nowell Feb 15 at 12:45
1
  • All files should be owned by the actual user's account, not the user account used for the httpd process.
  • Group ownership is irrelevant unless there are specific group requirements for the web-server process permissions checking. This is not usually the case.
  • All directories should be 755 or 750.
  • All files should be 644 or 640. Exception: wp-config.php should be 440 or 400 to prevent other users on the server from reading it.
  • No directories should ever be given 777, even upload directories. Since the PHP process is running as the owner of the files, it gets the owners permissions and - - can write to even a 755 directory.

You can use

chown www-data:www-data  -R * 
find . -type d -exec chmod 755 {} \;  
find . -type f -exec chmod 644 {} \; 
  • Thank you. I tried giving permission and defined the ABSPATH of tmp folder and it worked. – Rony Samuel Feb 26 at 5:24
0

I tried the following and it worked

add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
define('WP_TEMP_DIR', ABSPATH . 'wp-content/tmp');

The tmp folder wasn't having the permission and that caused the website plugins from updating.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.