Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Using the constant overrides in wp-config I'm able to define a remote FTP server that plugins will be added to when installed using the WP interface.

define('FS_METHOD', 'ftpext');
define('FTP_BASE', '/');
define('FTP_CONTENT_DIR', '/public_html/example.com/wp-content/');
define('FTP_PLUGIN_DIR', '/public_html/example.com/wp-content/plugins/');
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', '123.123.123.123');

What's weird to me is that there isn't a constant setup for themes or uploads. Themes I don't care about (but its still weird) ... I want uploads to be put on the remote server though. Ideally there would be an FTP_UPLOADS_DIR that could be overwritten the same way.

Any ideas on how to get around this?

share|improve this question
    
try setting WP_CONTENT_DIR to the wp-content directory the rest should be done for you by WordPress. –  Bainternet Jun 16 '11 at 23:37
    
Agreed you can use the WP_CONTENT_DIR as per the codex page –  xLRDxREVENGEx Jun 17 '11 at 0:24
    
Also note that it does not matter if you use a cdn to load the objects to but might involve extra coding for uploads –  xLRDxREVENGEx Jun 17 '11 at 0:25
    
Setting WP_CONTENT_DIR doesn't change anything. You're required to set WP_PLUGIN_DIR even if you set wp-content. Either way, it doesn't affect uploads. I realized, though, that plugins and WP upgrades are done via FTP. File uploads, however, use PHP -- not FTP. So a wp-config change may not be the route to take. –  developdaly Jun 17 '11 at 3:09
    
See related question and answer: wordpress.stackexchange.com/questions/52042/… –  developdaly May 31 '12 at 21:11

1 Answer 1

IMHO a better approach would be adding the remote server's directory as a locally mounted directory and use this as wp-content directory. Doing this on the block/filesystem level means that WordPress won't notice a thing, since it appears to WordPress as normal local directory. You may want to have a look at sshfs in order to mount the directory. Using this has the added benefits of:

  • not having to put your ftp password in file
  • no (slow/unreliable) php code having to act as ftp client
  • no need for ftp an insecure protocol by itself
  • no need for a ftp-server on the remote server
  • no need to change WordPress config
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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