WordPress Automatic Update Asking for FTP

I have a wordpress installation that I look after (in fact its phpwomen.org) and since upgrading it to 2.7 I see that it has lots of "click here to upgrade" buttons, both for the core code and even to upgrade and install plugins. However when I click on these, either the core upgrade or to install/upgrade a plugin, I get prompted for my FTP details.

I found this odd, as I thought I was downloading and unpacking a file. I read around and there isn't much information about this feature at all. It seems like such a useful thing if it would work, then I can give someone an admin login and they can just work everything from there without me giving them shell access. After a very frustrating few weeks of trying, I found out the answer.

WordPress can update without FTP

I don't need to install FTP on my server (good, I don't want to), I had incorrect permissions on my files. When the user that apache runs as can write to the wordpress directories, then the upgrade stuff all just works! The FTP credentials are for if the web server doesn't have the right information, then wordpress prompts you for your FTP details, and attempts to use those to FTP back to the same server it is on to be able to write the files it needs. As wordpress is often used in a shared hosting environment, this makes more sense than I first thought.

I really hope that helps someone, I spent ages being confused over this "feature"! If you have any more details or information, or if this works for you, then please add a comment below :) I'm off to enjoy my new wordpress feature ...

31 thoughts on “WordPress Automatic Update Asking for FTP

  1. Thanks! I've started playing with this now.

    It's slightly more picky than just requiring write permissions - the file owner has to be the apache user too.

    Regards,

    Rob...

  2. Sounds risky! If you're on shared hosting and Apache can write to your PHP scripts, then depending on how the server is setup other users on the server can alter your PHP code?

    • Tim,

      It's been a very long time since I was on shared hosting :) If you are on shared hosting, then you'll have FTP enabled which is handled nicely by WordPress.

      Rob...

  3. Thank you very much for that explanation. I just had this issue while moving one of my blog to another server.
    I will now need to know which directory permissions I must change to make it work.

  4. Guib: Start by making sure the whole wordpress directory is owned by the user your webserver runs as. Then make sure that user has write permissions to the main wordpress files and the plugins directory - and you should be good to go I think.

    • i am running into similar problems.

      the site gets created as the ftp user
      user= ftp group = psacln

      wordpress aumatically installs as
      user= apache group = apache

      do i simply add user apache to the group psacln?
      do i change the whole site to be owned the group apache and add the user ftp to thwe group apache as well?

      hopefully is is legible! (and fixable!)

  5. LornaJane wrote an article on her blog about WordPress automatic update asking for FTP. As I’ve been having problems with the automatic update too and since I also don’t want to install FTP I changed permissions as she suggested. Unfortun...

  6. Your Blog post just solved a problem that has been plaguing me for more than a year. At first I thought WordPress didn't update because it required FTP to update, and since my server has no FTP access I assumed I couldn't use the feature.

    Today, someone with FTP on their server had the same problem with auto update not working and providing a valid FTP password didn't do anything!

    So, 8 hours later, I chown -R apache:apache deactive the auto update plugin, and now update works on all my servers.

    Thank you so much for this blog post, WordPress documentation of their auto update is a miserable failure.

  7. Hmm..I have that problem but how exactly do I do it? I am not familiar with the term and how to change the permission.

    Could you please show me this step by step? if it's not too much to ask maybe? or do you know if someone have mentioned the steps in wordpress forum?

    thank you

      • Excellent, this plugin is PERFECT for our situation. We install WP into a jailcell from the customer and it has all the correct permissions for them to upload into the right areas but the wp-content folder isn't owned by apache. The yoast fix-plugin-update plugin overlooks the ownership on the plugin-install.php script and just puts the files where they should be - which is how it should be anyway!

        Thanks for the tip.

  8. Thanks,

    I have this problem for 3 years because i don't know it is problem. Until i have new web hosting that don't need ftp account info.

    Thanks for suggestion for plug in it work well in my old web server that need ftp for update wp plug in.

  9. There is a easier way with WP>2.9.2 (maybe even earlier)

    Just add in your wp-config.php:
    define('FS_METHOD','direct');

    That's all.

  10. Hi Lorna Jane,

    You are cool beyond words.

    Thanks for sharing this! I really didn't want to setup my server with FTP (I use openssl/sftp for file transfers).

    Thanks so much for offering this!

    Sincerely,
    Jay

  11. great insight. thank you. I moved my blog and forgot what I needed to do to avoid ftp. your suggestion works like a charm.

  12. Thanks so much to everyone that has dropped in and said that this tip is working for them - I had to refer back to this myself the other day to remind me how to get around the FTP prompt!

  13. I was really having some problems with my new virtual server and wordpress. Permissions and file ownership were driving me mad. I think I might have solved this by running PHP in CGI mode rather than Apache. Everything now seems to work as it did when I was on shared hosting. No doubt there will be some issues with this too, but so far so good.

  14. It works for me now, without the plugin ssh2 and without ftp config.
    I have just chown the www directory with user and group of apache (www-data in my case) and wp-content/plugins directory setted chmod to 755
    The automatic upgrade works fine now.

  15. So many people still popping in and letting us know it works on their system, thanks to everyone taking the time to comment and leave extra tips for others too!

  16. chmod /themes & /plugins & /upgrade to apache:apache/777
    changing define('FS_METHOD', 'ftpsockets'); to define('FS_METHOD','direct'); in .htaccess
    Did the trick for me for theme and plugin updates, BUT core WP update still doesn't work.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">