Wordpress asking for my FTP credentials to install

2019-01-12 17:04发布

I installed a Wordpress blog in my local system.But when I try to add plugins from admin it asks for FTP access. What do I need to configure for Wordpress to be able to upload without FTP?

标签: wordpress ftp
12条回答
相关推荐>>
2楼-- · 2019-01-12 17:46

I changed the ownership of the wordpress folder to www-data recursively and restarted apache.

sudo chown -R www-data:www-data <folderpath>

It worked like a charm!

查看更多
干净又极端
3楼-- · 2019-01-12 17:47

As mentioned by Niels, this happens because the server process user can't write to the Wordpress folder.

But here's the thing a lot of articles don't explain. It's the owner of the php process, not the nginx process. If you try to change the nginx owner, it won't solve this.

To solve it, try running ps aux to see which user owns the php-fpm process. Then check that user is the same user as the owner of the wordpress folder, or can at least write to it. If the user can't write to it, you'll need to change permissions and/or ownership of the folder; or put the two users (server owner and wordpress folder owner) in a common group which can write to the folder; or change php.ini "user" property to a user that can write to the folder.

查看更多
女痞
4楼-- · 2019-01-12 17:50

First move to your installation folder (for example)

cd /Applications/XAMPP/xamppfiles/

Now we’re going to modify your htdocs directory:

sudo chown -R daemon htdocs

Enter your root password when prompted, then finish it out with a chmod call:

sudo chmod -R g+w htdocs
查看更多
Root(大扎)
5楼-- · 2019-01-12 17:52

I did a local install of WordPress on Ubuntu 14.04 following the steps outlined here and simply running:

sudo chown -R www-data:www-data {path_to_your_project_directory}

solved my issue with downloading plugins. The only reason I'm leaving this post here is because when I googled my issue, this was one of the first results and it led me to the solution to my problem.

Hope this one helps to anyone!

查看更多
孤傲高冷的网名
6楼-- · 2019-01-12 17:58

Try to add the code in wp-config.php:

define('FS_METHOD', 'direct');
查看更多
倾城 Initia
7楼-- · 2019-01-12 17:58

On OSX, I used the following, and it worked:

sudo chown -R _www:_www {path to wordpress folder}

_www is the user that PHP runs under on the Mac.

(You may also need to chmod some folders too. I had done that first and it didn't fix it. It wasn't until I did the chown command that it worked, so I'm not sure if it was the chown command alone, or a combination of chmod and chown.)

查看更多
登录 后发表回答