giovedì 19 settembre 2013

Fixing WordPress’ Plugin FTL download permissions (WordPress 3.3.1 on CentOS Linux)

Hav­ing trou­ble with Word­Press’ auto update fea­ture? Con­fronting errors like "could not copy file…"  or is Word­Press ask­ing for FTP information?


Your prob­lem is most likely server per­mis­sions. If you have shell access to your own VPS/dedicated server, use the lines below. If you’re using a shared host­ing setup, try option #4 below, or con­tact your admin­is­tra­tor for help.

Option #1: chmod 777

Sure, you could CHMOD 777 your whole site. That would tech­ni­cally work, but it’s switch­ing per­mis­sions when­ever you need to update is incon­ve­nient. And, leav­ing per­mis­sions this way leaves you open to a whole host of secu­rity issues.
chmod -R 777  (Not Secure!)

Option #2: apache file permission

This gives apache full per­mis­sions. This works, but if you use FTP, users no longer have per­mis­sions to write files. No good! I want my FTP access intact.
chown -R apache:apache  (No FTP!)

Option #3: apache /w group permissions

I cre­ated a “word­press” group and added my FTP users to it and gave the wp-content direc­tory group write per­mis­sions. It’s a bit of a com­pro­mise, but it worked for me.
groupadd wordpress
useradd -G wordpress 
chmod -R 775 /wp-content/
chown -R apache:wordpress 

Option #4: wp-config constants

Another option for those who are unable to change file per­mis­sions, and/or have a rel­a­tively new ver­sion of Word­Press, is to bypass enter­ing FTP infor­ma­tion by defin­ing your FTP info in your wp-config.php file. More infor­ma­tion can be found in the Word­Press codex.
define('FS_METHOD', 'ftpext');
define('FTP_BASE', '/path/to/wordpress/');
define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
define('FTP_USER', 'username'); 
define('FTP_PASS', 'password');
define('FTP_HOST', 'ftp.example.org');

9 commenti:

  1. I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information…....

    RispondiElimina
  2. This is a nice article..Its very easy to understand ..And this article is using to learn something about it..

    RispondiElimina
  3. Thanks for sharing this useful info. Keep updating same way.

    RispondiElimina
  4. I see the superlative contents on your blogs and I perfectly enjoy going through them. Thanks for sharing this useful info. Keep updating same way.

    RispondiElimina
  5. I appreciated your kind way of knowledge.Great Stuff Here..hope more to come.Nice work!
    by Homework Assignments provider

    RispondiElimina
  6. I actually delighted in the insign you express to the subject, awe motivating stuff ..
    by BCOM 275 provider

    RispondiElimina
  7. Thanks for large information you compose it very clean. I am very fortuitous to get this tips from you.
    by MKT 571 Entire Course provider

    RispondiElimina