Wordpress setup on test server asks for ftp information
Saturday, December 19th, 2009If you have a test server installed on your machine at home (or elsewhere) to do web development work, you may run into this common problem. You try to do something that writes to your server (wordpress plugin upgrades, for example) and it wants ftp information!
What ftp? Its already running on the same machine. The thing is, your wordpress has not been installed by the same user as your apache. The easiest way to sort this out is to change ownership of the wordpress folder to the same user as apache, and the thing will no longer want ftp passwords, because it can write to the directories and uses its regular ‘get’ thing.
How do you go about doing it? You tried changing ownership, and it refused. You are sure you own the wordpress, but are not able to transfer it. This happens because this ownership can only be changed by the root. So what you have to do it:
sudo -i <-- This makes you root (as different from running stuff as root, which you probably tried while changing permissions)
Then you go into your wordpress directory:
cd /var/www/wordpress <-- This has to be whatever your path is
Now to change the permissions:
find wp-content | xargs chown www-data:www-data <-- Here, wp-content can be any folder you want the software to be able to write to.
That's it. Done. Now try to upgrade those plugins, and it should be smooth as silk - no questions asked that you can't answer.