1

While I am trying to upgrade the wordpress plugins it Asks for FTP Details.

I have added the following to wp-config.php

 define('FTP_USER', 'username');

 define('FTP_PASS', 'password');

 define('FTP_HOST', 'host address');

It has worked fine. But I have multiple websites working on my virtualmin server. All the wordpress site is having the same wordpress plugin issue. So is there any other fix that could resolve the Issue?

Gordon
  • 312,688
  • 75
  • 539
  • 559
user2205803
  • 13
  • 1
  • 4

4 Answers4

4

I just found these: link 1 and link 2, where I dug out this:

WordPress asks for your FTP credentials when it can't access the files directly. This is usually caused by PHP running as the apache user (mod_php or CGI) rather than the user that owns your WordPress files (suPHP or FastCGI). Switching over to using suPHP or FastCGI would probably fix it. Of course, if you don't want to mess with that, you can always just put your FTP credentials directly in wp-config.php or use this in the shell:

 pae$ cd /var/ww
 pae$ sudo chown -R www-data:www-data wordpress
gersande
  • 465
  • 1
  • 8
  • 25
  • I also found this link: https://web.archive.org/web/20140926070648/http://bornvirtual.com/wordpress/stop-wordpress-asking-ftp-details/713/ which may also be useful. – gersande Jun 02 '13 at 06:52
  • 1
    I have changed the permission of wp-content apache:apache, Now the Issue has been resolved. So how could I change the apache:apache to the username:username for there corresponding sites – user2205803 Jun 02 '13 at 07:09
  • 2
    as a note for me and others, `$ sudo chown -R www:www [wp-folder]` worked for me on Mac OSX. The above solution didn't work. – Larry Mar 25 '14 at 08:33
0

The best way to deal with wordpress installation on apache is to use the secondary user and group to apache which would not cause these issue while updating or installing plugins and using other wordpress functions. just change your apache config file User and Group to your username and group name User [yourusername] Group [yourgroupname]

0

In wp-config just write

define('FS_METHOD', 'direct');
Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
  • 1
    Welcome to StackOverflow. While this code may answer the question, providing additional context regarding *how* and/or *why* it solves the problem would improve the answer's long-term value. – Sven Eberth Aug 29 '21 at 21:42
-1

Are you hosting your WordPress sites on one of those hosts where WordPress asks you to provide FTP details before upgrading itself or upgrading plugins? So Now WordPress will stop asking you for FTP details Here’s how you can do it Open your wp-config.php file locate in your wordpress root directory And copy and past below detail after your database detail block in wp-config.php file

define(“FTP_HOST”, “ftp.yourhost.com”);
define(“FTP_USER”, “ftpusername”);                                           
define(“FTP_PASS”, “ftppassword”);
Brad Larson
  • 170,088
  • 45
  • 397
  • 571