Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

During upload of plugin files, WordPress is coded to first check if it can write to wp-admin and wp-content. If this check fails WordPress will fail and provide the unhelpful message that it requires ftp credentials.

This kind of check is a good, but the current (as of May 16, 2013) code to perform this check is not well written.

The "check" looks at the process id running WordPress (in our case www-data) and determines if it is equal to the directory owner id. Anything else, such as having the owner id be serveradmin and granting group www-data write access will not work.

In the BonsaiFramework WordPress Simplified process we compromise and set the user id specifically for wp-content and wp-admin. However, some administrators will want to be more consistent granting serveradmin as the user id and www-data as the group id with group set to also have write access as shown below,

drwxrwx--- 9 serveradmin www-data     4096 May 16 16:07 wp-admin
drwxrwx--- 6 serveradmin www-data     4096 May 16 22:01 wp-content

Go to your shell, load your favourite editor and paste the contents of the wp-config.php file,

vi /opt/web/php/dailyplanet.com/blog/wp-config.php

Also while you are there add the following to the bottom of the file,

# WordPress determines write access by checking if the Web Server ID and the directory ID being written too matches.
# During manual file upload the failure results in a prompt for FTP login information.
# The failure will occur regardless if permissions are granted using other means such as group access or ACLs access.
# This line overrides the write check by forcing a direct write.
define('FS_METHOD', 'direct');
  • No labels