Why WordPress Asks for Connection Info

One of the great features of WordPress is that it allows you to automatically install and upgrade plugins.

A common problem is that WordPress is unable to access the filesystem directly, which results in a page indicating that “To perform the requested action, connection information is required.

Connection Information

If you feel that your WordPress installation should not be asking you for this information, or you simply do not want WordPress to use this method of plugin management, you may be able to work around it.

What is Causing This?

Whenever you use the WordPress control panel to automatically install, upgrade, or delete plugins, WordPress must make changes to files on the filesystem.

Before making any changes, WordPress first checks to see whether or not it has access to directly manipulate the file system.

If WordPress does not have the necessary permissions to modify the filesystem directly, you will be asked for FTP credentials so that WordPress can try to do what it needs to via FTP.

Why Can’t WordPress Write To The Filesystem?

In order to understand why WordPress can’t write to the filesystem, we need to take a look at some WordPress internals.

The following code is from the get_filesystem_method() method in the wp-admin/includes/file.php file:

if( function_exists('getmyuid') && function_exists('fileowner') ){
    $temp_file = wp_tempnam();
    if ( getmyuid() == fileowner($temp_file) )
        $method = 'direct';
    unlink($temp_file);
}

This code creates a temporary file and confirms that the file just created is owned by the same user that owns the script currently being run. In the case of installing plugins, the script being run is wp-admin/plugin-install.php.

This may seem a little counter-intuitive, since the only thing WordPress really needs to be able to do is write to the wp-content/plugins directory.

What Can I Do About It?

In order to fix this issue, you will need to make sure that the scripts which need to write to the filesystem are owned by the same user that apache is running as.

Many hosting companies will run your apache instance using your user account, and all of your files will be owned by the same account. In those cases, you will probably not have the issue described here.

If your hosting company is running apache as a system user, and your files are owned by your own account, your only option may be to enter your FTP credentials here and allow WordPress to use FTP.

If you are running on a hosting company that gives you root access, or you have installed WordPress on your own development machine at home or at work, you should be able to modify the filesystem permissions to allow WordPress to directly access the filesystem.

The easiest way to do this is to find out what user apache is running as and change ownership of the entire WordPress directory to that user. For example, if apache is running as ‘httpd’, you could use the following commands on your WordPress installation directory:

# chown -R httpd: wordpress

Note that not all versions of chown are equal. If that command does not work, see your local chown man page for usage information.

Chris Abernethy
PHP Wrangler, MySQL DBA, Linux SysAdmin and all around computer guy, developing LAMP applications since Slackware came on 10 floppy disks.

76 Comments on "Why WordPress Asks for Connection Info"

  1. Dave says:

    Brilliant. This worked great for my Mac installation.

  2. Hi all. I discovered your current weblog the effective use of windows live messenger. Now you have an really logically prepared content. We’re absolute to book mark the idea obtainable here we are at find out more of this useful information and facts. Thank you for the particular submit. Let me absolutely recovery.

  3. come6781 says:

    #file_links[F:\长尾关键词时时彩1.txt,1.N]

  4. I’m not sure where you are getting your info, but good topic.
    I needs to spend some time learning more or understanding
    more. Thanks for fantastic info I was looking for this info for my mission.

  5. This is really fascinating, You’re a very skilled blogger.
    I have joined your feed and look forward to in the
    hunt for extra of your excellent post. Additionally,
    I’ve shared your site in my social networks

  6. cristian says:

    worked like a charm, thanks!

  7. Bryan says:

    Thanks for posting this; it’s interesting that the script needs to be owned by the web user–not as obvious as requiring write permissions.

    However, aren’t there security issues with giving web user ownership of the entire WP installation? Isn’t there a way to give ownership of only the required files? I tried chown-ing only theme-install.php and such, but that didn’t seem to help.

  8. Bryan says:

    Despite WordPress logs being uncannily difficult to create/populate, I FOUND IT!

    Under wp-admin, change ownership of these files to the user running WP:
    plugin-install.php
    theme-install.php
    update.php

    [code]chown httpd: plugin-install.php theme-install.php update.php[/code]

    Allows installation of themes and a plugins without granting ownership of the entire WP repository (naturally write permissions to wp-content are still required).

    Gravy.

  9. Bryan says:

    Drat. I guess expecting code tags to work in a blog comment stream was a bit silly…
    chown httpd: plugin-install.php theme-install.php update.php

    I’m wondering if you’ve recently allowed Google to index your pages (less than a month of comments on a five-year-old post).

    Thanks again. You led me to the solution I needed.

  10. Ian S. says:

    Thank you so much!
    I was stuck, tried several suggestions from good people around the web. Nothing worked but changing the owner of the WP root folder.
    Because I use Kubuntu (based on ubunto 14.04) I had to change the owner to ‘www-data’
    so if others have the same problem, this is what I used in konsole:
    ‘sudo chown -R www-data:www-data ‘

  11. Juan Pablo p. says:

    Thanks for the solution.
    I used this for Ubuntu 14.04 with XAMPP
    $sudo chown daemon:www-data /opt/lampp/htdocs -R

  12. warren says:

    This is not smart advice: # chown -R httpd: wordpress
    This is somewhat equivalent of giving 777 permissions, though to be clear, there are “permissions” and there is “ownership” and both affect how the files and directories are accessed.

    Directories should always be: 755
    Files should always be: 644

    The proper course of action would be to correctly configure and implement one of the following:

    1. suPHP
    2. FastCGI + httpd-itk
    3. PHP-FPM + mod_proxy_fcgi

    To reset file and directory permissions recursively use the following commands:

    find . -type f -exec chmod 644 {} \;
    find . -type d -exec chmod 755 {} \;

    The “.” says “start from where I am right now and recursively set everything under this directory to these permissions”

    For a more absolute method you can use anywhere, give the full path:
    find /var/www/example.com/ -type f -exec chmod 644 {} \;
    find /var/www/example.com/ -type d -exec chmod 755 {} \;

    Hopefully this clears this all up.

  13. Euhhh êtes vous certain de ce quе vous écrivez ??

  14. To solve the problem, just change the permissions of / var / www or public_html directory. Ex: chown-R www-data: www-data .

  15. Hi, I do believe this is an excellent web site. I stumbledupon it ;) I will revisit yet again since I book-marked it.
    Money and freedom is the best way to change, may you be rich and continue to
    help others.

  16. la angels says:

    Hi еveryone, іt’s my first go to ѕee at this web site,
    and post is actually fruitful іn support of me, ҝeep up posting tɦese content.

  17. health says:

    Such foods are great to have after a workout regime or sporting activities.
    prebiotics market with mannan-oligosaccharide (MOS) predicted
    to be the fastest growing product. When e-waste finds its way into landfills such toxic metals seep out and contaminate the soil and water, causing health problems and polluting the atmosphere.

  18. Howdy! Someone in myy Facebook group shared this site with us so I came to
    look it over. I’m definitely enjoying the information. I’m bookmarking
    and wikl be tweeting tgis to my followers! Fantastic blog and fantastic design.

  19. For newly engaged couples, the reputations of creative designers assure them of a special layout and
    Albuquerque Jewelry Stores that have a substantial inventory of loose, large-top quality diamonds let customization of their engagement ring to fit their
    budget. Comprehending the four “Cs” Clarity Clarity indicates the gem’s “inclusions” or imperfections that display the tiny
    mineral deposits and fractures found in the rock. If in doubt,
    think about all the antique rings you see set with semi- precious gems that are still in pristine condition after 50 or 100 years.

  20. JoiseyGuy says:

    Thanks much! This helped me get around the FTP issue when installing a plugin.

  21. Moreover, these dolls usually are dressed in conventional ethnic clothes.
    Children are now encouraged to have delight in their ethnic cultural backgrounds.

  22. Derick says:

    I know this website gives quality dependent posts and extra material, is there
    any other web site which offers these things in quality?

  23. Wrought iron, copper, and tin silhouettes are particularly popular for these types of items.

    The metal wall art is brilliant and stunning with values and realism.
    In fact, it was greatly impacting American and European sculptures and
    paintings.

  24. First off I would like to say terrific blog! I had a quick question that
    I’d like to ask if you don’t mind. I was curious to
    find out how you center yourself and clear your mind
    before writing. I’ve had difficulty clearing my mind in getting my ideas out.
    I do enjoy writing however it just seems
    like the first 10 to 15 minutes are wasted just trying to figure out how to begin.
    Any suggestions or tips? Thank you!

  25. Hello! I know this is kinda off topic but I was wondering which
    blog platform are you using for this site? I’m getting fed up of WordPress because I’ve had issues with hackers
    and I’m looking at alternatives for another platform.
    I would be fantastic if you could point me in the direction of a good platform.

  26. Had similar issues on my VPS and I was pulling my hair out to get it to work thanks for the tips!

  27. Hello, i read your blog from time to time and i
    own a similar one aand i was just wondering if you get a lot off
    spam feedback? If so how do you stop it, any plugin oor anything you
    can advise? I get so much lately it’s driving me mad so any help
    iis very much appreciated.

  28. Hello, this weekend is good for me, since this point in time i am reading
    this impressive educational article here at my house.

  29. Dacia says:

    I all the time used to study article in news papers but now as I am a
    user of internet thus from now I am using net for content, thanks to
    web.

  30. tleo.es says:

    This piece of writing gives clear idea designed for the new viewers of blogging, that in fact
    how to do blogging.

  31. lsd says:

    +1, with accurate privilege it worked without requesting ftp login.

  32. Augusta says:

    Your style is unique in comparison to other folks I have read stuff from.

    Thanks for posting when you’ve got the opportunity, Guess I
    will just bookmark this site.

  33. Hi colleagues, its wonderful article about educationand entirely explained,
    keep it up all the time.

  34. Howdy are using WordPress for your blog platform? I’m new
    to the blog world but I’m trying to get started and
    create my own. Do you need any coding knowledge to
    make your own blog? Any help would be greatly appreciated!

  35. Marty says:

    Hi there! This post couldn’t be written any better! Reading this post reminds me of my
    previous room mate! He always kept chatting about this.
    I will forward this write-up to him. Pretty sure he
    will have a good read. Many thanks for sharing!

  36. I believe that is one of the so much important
    info for me. And i’m satisfied studying your article.
    But should observation on some general things, The site style
    is wonderful, the articles is truly nice : D.
    Just right job, cheers

  37. edublogs.org says:

    Aw, this was an extremely good post. Taking the time and actual effort
    to generate a superb article… but what can I say… I procrastinate a lot and don’t manage to get anything done.

  38. If some one wants to be updated with newest technologies therefore he must be pay
    a visit this website and be up to date daily.

  39. Pretty part of content. I simply stumbled upon your blog and in accession capitazl to claim that
    I get actually enjoyed account your weblog posts.
    Any wway I’ll be subscribing for your augmeent or even I achievement you access
    constantly fast.

  40. Hmm is anyone else experiencing problems with the images on this blog loading?

    I’m trying to find out if its a problem on my end or if it’s the blog.
    Any feedback would be greatly appreciated.

  41. camping trip says:

    Hey there! Do you know if they make any plugins to help with SEO?
    I’m trying to get my blog to rank for some targeted keywords but I’m not
    seeing very good results. If you know of any please share.
    Appreciate it!

  42. Wilhemina says:

    Hello, for all time i used to check weblog posts here in the
    early hours in the daylight, since i like to find
    out more and more.

  43. sn9999 says:

    หมอตำแย , ผมคิด บล็อกของคุณ เว็บเบราเซอร์ ที่เข้ากันได้ ปัญหา เมื่อฉัน
    ดูที่ ของคุณ เว็บไซต์ ใน Safari ก็ ดูดี แต่เมื่อ ใน IE , ที่มี ปัญหา ที่ทับซ้อนกัน
    ฉัน เพียง ต้องการที่จะ ให้ หัว รวดเร็ว ขึ้น อื่น ๆ กว่าที่ , ยอดเยี่ยม
    เว็บไซต์

  44. Refugio says:

    My relatives every time say that I am killing my time here at web, but I know
    I am getting experience daily by reading thes pleasant
    articles or reviews.

  45. Buy HCG says:

    HCG is the most effective, permanent weight loss program to both men and women, in particular, those
    who have given up hope in their journey to permanently lose weight.
    The increase will remain even after you have stopped using the hormone.
    It aromatizes (changes) to estrogen, a molecule proven to increase
    fat storage and decreases muscle mass.

  46. KhBesT says:

    This worked for Ubuntu 14.04 as well, Thanks a lot!

  47. Sonic Sprint android coach is simple to utilize and you can simply add gods to your account.

  48. This is because they do not feel starved or deprived.
    Just before you lose all hope of losing weight, check out
    the Dr Simeons h – CG diet. Sugars and starches are still off limits for the
    next three weeks.

  49. Daniella says:

    Hello, i believe that i saw you visited my weblog thus i
    got here to return the choose?.I am attempting to to find
    issues to improve my website!I assume its ok to make use of a few of your concepts!!

  50. Good article. I absolutely love this website. Thanks!

  51. Article writing is also a excitement, if you know then you can write otherwise
    it is complicated to write.

  52. Neat blog! Is your theme custom made or did you download it
    from somewhere? A design like yours with a few simple adjustements
    would really make my blog shine. Please let me know where you got
    your theme. With thanks

  53. Dave says:

    Good post, works like a charm

  54. Caridad says:

    But they usually beat around the bushes and expect you to do what Arnold does, a million sets and 5 hours of steady pumping iron.
    When creating a slogan, aim for the heart by playing up the
    emotional effect. Boxing exercise in intervals and with
    high intensity is the key to lightening fast results.

  55. I know this web site gives quality based articles or reviews and extra information, is there
    any other site which provides these things
    in quality?

  56. Right here is the right web site for anybody who would like
    to understand this topic. You realize a whole lot its
    almost hard to argue with you (not that I actually would want to…HaHa).
    You certainly put a fresh spin on a topic that has been discussed for many years.
    Wonderful stuff, just wonderful!

  57. ranssudanhel says:

    Over half of all Americans aged 60 and older have high blood pressure.

    Related Articles:

  58. monchecubley says:

    Chen Pi tangerine peelChen pi is Spleen and kidney tonic herb.

    Related Articles:

  59. Undeniably believe that that you said. Your favourite
    reason appeared to be on the net the simplest factor to be mindful of.
    I say to you, I definitely get annoyed at the same time
    as people consider issues that they plainly do not understand about.
    You controlled to hit the nail upon the top and also
    outlined out the whole thing with no need side-effects ,
    other people could take a signal. Will likely be back to get more.
    Thank you

  60. Great article! We will be linking to this particularly great content
    on our site. Keep up the great writing.

  61. I am in fact thankful to the owner of this site who has shared this enormous paragraph at at this place.

  62. photo lyon says:

    You ought to take part in a contest for one of the best
    sites on the net. I am going to highly recommend this web site!

  63. You really make it seem so easy with your presentation however I in finding this matter
    to be actually one thing which I feel I’d never understand.
    It seems too complex and extremely huge for me. I’m taking a
    look ahead to your next submit, I’ll try to get the cling of it!

  64. Emory says:

    magnificent submit, very informative. I’m wondering why the opposite specialists of this sector do not notice this.
    You must proceed your writing. I am confident, you’ve a great readers’ base already!

  65. Hmm it appears like your site ate my first comment (it
    was extremely long) so I guess I’ll just sum it up what I had written and
    say, I’m thoroughly enjoying your blog. I too am an aspiring blog blogger
    but I’m still new to the whole thing. Do you have any suggestions for rookie
    blog writers? I’d certainly appreciate it.

  66. Good day! I know this is kinda off topic but
    I was wondering if you knew where I could locate a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having difficulty finding one?
    Thanks a lot!

  67. Spire Ecig says:

    Very good info. Lucky me I recently found your site by accident (stumbleupon).
    I’ve saved as a favorite for later!

  68. For the reason that the admin of this website is working, no doubt very
    rapidly it will be renowned, due to its feature contents.

  69. mold damage says:

    Good day! Would you mind if I share your blog with my facebook group?
    There’s a lot of people that I think would really enjoy your content.
    Please let me know. Thank you

  70. I know this web page offers quality based content and other
    information, is there any other website which offers
    these things in quality?

  71. Testostorm says:

    I don’t know if it’s just me or if everyone else experiencing problems
    with your blog. It seems like some of the text in your posts are running off the screen. Can someone else please comment and let me
    know if this is happening to them too? This could be a issue with my internet browser because
    I’ve had this happen before. Appreciate it

  72. alleure says:

    Excellent article. I’m going through some of these issues as well..

  73. Katrice says:

    I don’t know whether it’s just me or if everybody else encountering problems with your site.
    It appears as though some of the written text in your
    posts are running off the screen. Can someone else please
    provide feedback and let me know if this is happening to them too?
    This might be a problem with my internet browser because I’ve had this happen before.
    Cheers

  74. Tanveer Hossain Jony says:

    thanks a lot. working. is this comment too short?

  75. Parking says:

    Your style is so unique in comparison to other folks I
    have read stuff from. Thanks for posting when you have the opportunity,
    Guess I will just book mark this site.

Got something to say? Go for it!