wordpress asks for ftp password while installing plugins - wordpress

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

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');

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');

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

Related

How to install WordPress Theme or Plugin on XAMPP-VM (Mac OS)

I have installed WordPress on XAMPP-VM (don't use addon).
But when I add new Theme or Plugin, I need to enter FTP credentials and I don't know what username/password I should to use.
I can connect with account daemon/xampp but must change the permission of htdocs folder to 777.
What FTP account I can use that I don't need to change permission to 777?
Please see:
How to setup FTP on xampp
Alternatively, do note that you don't need to change the permissions on the htdocs folder proper, you can do it in on the plugins and themes folders in wp-content. See:
Wordpress FTP connection setting for localhost to upload and install WooCommerce
Please use your system(means laptop/desktop) username and password here
This is due to the permission issue, you can avoid it by writing the following code into your wp-config.php :
define('FS_METHOD', 'direct');
Hope this will help.

Not able to add plugins

We have a blog setup on WordPress and our server is a linode instance which we connect through ssh.
Now when I am trying to add yoast plugin it is asking me for FTP credentials and when I am entering them still it is not connecting.
Please advise on this as we are not able to add plugins to our site.
This is a permissions issue with your server, run the following command in your SSH terminal:
sudo chown -R www-data:www-data /var/www
This will grant your WordPress sites the permanent ability to add/update plugins and themes.
It might be Permission issue. Try these simple steps:
1: Open Filezilla and after entering FTP Access, connect to directory
where your wordpress files exist.
Now right click on the Parent Folder of your wordpress installation and click on "Change Permission" Now enable Read/Write/Execute.
Now try again with Yoast Plugin. It should Work.
https://codex.wordpress.org/Changing_File_Permissions
Let us know if it worked.

Not able to install plugins in Wordpress

I've a wordpress hosted in Rackspace cloud server. The site is working fine. To access the wordpress admin panel i have setup FTP access to the root user. I'm able to access and create files via FTP and the wordpress admin can connect to the server via FTP.
But i'm not able to install new plugins from the wordpress admin panel.I'm getting the following errors.
Downloading install package from https://downloads.wordpress.org/plugin/icon-list.0.3.zip…
Unpacking the package…
Could not create directory.
Return to Plugin Installer
First i thought it was some permission issue. But in the server i've set the permissions 777 to the wordpress project folder.But its still showing the same error.
Is there any configuration change made, to be able to install the wordpress plugins successfully.
Set the write permission for your FTP user.
Read Wordpress file permissions from here Changing_File_Permissions
It's can be also a problem with web hosting configurations. Try the FTP method. Reference here.
Add the following lines in your wp-config.php
define('FS_METHOD', 'ftpext');
define('FTP_USER', 'YOUR FTP LOGIN');
define('FTP_PASS', 'YOUR FTP PASSWORD');
define('FTP_HOST', 'YOUR FTP HOST (without http:// or ftp://)');
define('FTP_SSL', false);
Another way :
Your web server has write permissions, then add this to your wp-config.php file:
define('FS_METHOD', 'direct');
Also, wanted to add that you must NEVER set the wp-content permission or permission of any folder to 777.

Wordpress plugins it asks for FTP Details

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?
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
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]
In wp-config just write
define('FS_METHOD', 'direct');
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”);

How to install new WordPress theme on Ubuntu in XAMPP?

I am new to WordPress. I just installed on my Ubuntu with XAMPP on localhost not live server.
My WordPress version is 3.5.1.
Now when I try to install new theme it shows the below message
To perform the requested action, WordPress needs to access your web
server. Please enter your FTP credentials to proceed. If you do not
remember your credentials, you should contact your web host.
And prompts for hostname, ftp username and ftp password.
Are you trying to install the theme over the web or you have a local copy of it?
You can check this link that describes your issue to some extent:
http://www.jasong-designs.com/2012/01/14/ubuntu-linux-permissions-and-a-local-wordpress-install/
and this too:
http://www.chrisabernethy.com/why-wordpress-asks-connection-info/
Add this to your wp-config.php
define('FS_METHOD','direct');
Due to linux having such a more restrictive file system, this will enable to you write directly to the folder.
This will solve that ftp problem while installing new plugin or theme.
try using the username: nobody and the password: xampp or root or toor or**
your localhost password [if not blank]
**

Resources