0

I have a centos with user anamika with ftp loging.

I create wordpress folder loging with user anamika in webroot directory. User anamika has apache as primary group. The create folder gets user of anmika:apache when create.

When I try to install plugin it asks for ftp login.

When I changes user from anamika:apache to apache:anamika it works fine.

Please suggest a way to solve this user issue.

I checked following suggestion and wordpress blogs but didn't worked. Wordpress plugins it asks for FTP Details Wordpress asking for my FTP credentials to install plugins Installing plugin for wordpress website hosted locally is asking for ftp details

Community
  • 1
  • 1

3 Answers3

1

If WordPress asking hostname and connection details for installing plugin and themes, we need to add a function hook in the wp-config.php file in the home directory.

define('FS_METHOD','direct');

Girish Vas
  • 680
  • 1
  • 10
  • 22
  • please refer https://stackoverflow.com/questions/13233152/install-a-theme-in-local-machine-should-i-need-the-ftp-data-connection/27754477#27754477 – Girish Vas Oct 17 '19 at 14:40
  • it's a way when web server permissions are set well. If not adding hook wouldn't work. Best solution would be set plugins and upload directory permission properly. – Krishna Pariyar Oct 17 '19 at 16:46
0

You can use Paste the following code to your wp-config.php file, preferably just below every other line of code to install plugin without ftp details...

define('FS_METHOD','direct');
Gaurav Jariwala
  • 523
  • 2
  • 12
  • Gaurav Jariwala, Thank You for your suggestion. What I am searching for a way to add user to group apache and work without adding codes to wp-config.php files. I tried addring user to group apache but it didn't worked. – Krishna Pariyar Apr 14 '16 at 09:01
0

The issue was with the permission of the user apache. I changed the user and group of the apache in httpd.conf file to the ftp user and it solved the issue. Changed User apache Group apache to User anamika Group anamika