Wordpress asking for FTP Credentials

February 21, 2014 80k views
https://www.digitalocean.com/community/articles/how-to-install-wordpress-on-ubuntu-12-04, Okay, I used this for installing my wordpress. When I am trying to install a new theme, it is asking for FTP credentials, but I don't know what to insert.
1 comment
  • I am using a similar site called http://www.vps.net/ I purchased their Ubuntu 16.04 VPS 12 dollars a month for 1 GB of RAM and 25 GB of storage. I used shell access and a tutorial on how to install the LAMP stack, and install WordPress using the chown and chmod commands. I assigned the user wordpressuer with sudo priveleges, and I created an SQl database with the same user using PHP My Admin. All was going well and smoothly, up until I got to the point where I needed to update WordPress and or install additional plugins. I tried using WinSCP to set every single file with 7777 permissions, but it still keeps asking me for FTP credentials, and I haven't found any tutorials on how to set up an FTP server on Ubuntu 16.04 that could solve this problem until I can figure out why I keep getting this error. My WordPress and other stuff is in /var/www/html. I have it set up so that my WordPress is installed in a directory called /blog, and my podcast generator in /podcasts.
    Also, there is a popular CMS called Podcast Generator which I mentioned above. Before installing, it runs some scripts to determine if it has the needed writing and execution permissions in the following directories. If there are problems, it will tell you so you can change the writing permissions to 7777. I think WordPress needs to have something similar so it can be made easier to troubleshoot errors like these.

34 Answers
Does running the following commands fix it?
sudo chown username:www-data /var/www -R 

sudo chmod g+w /var/www -R

This is user's permission problem that will be solved by method given below that worked for me.

step-1 : First open wp-config.php file of your wordpress installation folder.
step-2: Copy below code and paste it at the end of the wp-config.php file.

define('FS_METHOD','direct');

step-3: Now open your droplet access console and enter root as username and its password.
step-4: Copy below code and paste it into access console where you have to specify your plugin directory path and then hit enter.

chmod 777 /yourwebsitename/public/wp-content/plugins/

Note: Replace your website name in the place of yourwebsitename.
Thank you.

After you upload your files, you’ll want to make sure ownership permissions are set to Apache so that Wordrpess can update and/or install plugins without requiring FTP credentials. You can set permissions via SSH.

Single site hosting:

chown -R apache:apache /var/www/html

Multi site hosting:

chown -R apache:apache /var/www/

You may need to do this whenever uploading folders.

Source: http://www.visiblexposure.com/seomiami/configure-server-permissions-wordpress-not-require-ftp-plugin-installsupdates/

WordPress usually asks for your FTP credentials when it can't access the files directly on the root of your webserver. This is usually caused by PHP running as the apache user (mod_php or CGI) rather than the user that owns your WordPress files.

More info on the WordPress Forum:
http://wordpress.org/support/topic/plugin-install-asks-for-ftp-details
Thank you Kamal! This works for me!
Kamal this is not working for me

ryanginx that worked for me too. thx!!

Please, I run `sudo chown username:www-data /var/www -R
sudo chmod g+w /var/www -R
but don't work to me.```

How should I replace the commands??? Sorry, I'm beginner...

I insert

define('FS_METHOD', 'direct');

And too not works...

define('FS_METHOD', 'direct');
This worked for me too.

sudo chown username:www-data /var/www -R

you can login width root and Type the command: ```

sudo chown -R {path}
  • {path}: is path to your website, ex: /home/admin/domain/mywebsite.com ```
  • If you log in as root you do not need to type "sudo" as you will be root. I highly suggest not logging in as root to do this. The point of typing in "sudo" is to request root permissions for that 1 command..

Currently, wordpress hosting is being used by quite a lot of customers with different advantages. However, to know the information about the hosting quality and attract customers today we would like to introduce to you the address. provide quality HCM VPS

We specialize in providing the most affordable brochure printing service on the market, with quality publications and quick customer referrals in to roi , we are confident to be the No. 1 leaflet retailer in the Lake market. Ho Chi Minh

Chúng tôi chuyên cung cấp ghế sắt(http://ghesat.net/) chất lượng uy tín và đặc biệt là giao ghế sắt chất lượng tận nơi miễn phí cước giao hàng nhé.

use this code , wordpress asking for ftp details because wordpress doesn't have permission to write in your server.
use these two commands in terminal.

$sudo a2enmod rewrite
$sudo chown -R www-data /var/www

video guide [https://www.youtube.com/watch?v=RGGWVUIvhnk](http://)

Ghé thăm shop http://ngoinhahanhphuc.vn của chung tôi để tìm cho mình một sản phẩm chính hãng hàng đầu trong điều trị bệnh yếu sinh lý ở nam giới

một sản phẩm từ thảo dược tự nhiên tuyệt vời cho mẹ và bé đó chính là nước tắm elemis . một loại sữa tắm dành cho bé yêu của bạn. bảo vệ bé an toàn, làn da luôn thoáng mát và mịn màng

cung cấp nước hoa kích dục nữ mạnh nhấ tốt nhất giá rẻ nhất tại website nước hoa sinh lý

Shop nuochoakichthich.info chuyên cung cấp những dòng sản phẩm nước hoa cho nam và nữ chất lượng - giá rẽ.

Đại lý đèn led chất lượng uy tín denledduyhung chuyên cung cấp các loại đèn led chất lượng uy tín nhất thị trường hcm

Quà tặng doanh nghiệp mixco chuyên cung cấp chất lượng uy tín giao hàng tận nơi tphcm, cuyên cung cấp những dòng sản phẩm chất lượng uy tín nhất tphcm.(http://mixco.com.vn)

Currently inthanhtien.com company is the largest printing service company in tphcm market, quality products prestige tphcm delivery, we specialize in printing the cheapest price in the market, please contact us. To print the cheapest plastic packaging on the market, now our company is located in Ho Chi Minh City, this is the most prestigious printing facilities in the market, please contact to know. More information.

Have another answer? Share your knowledge.