Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 499 Vote(s) - 3.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WordPress asking for my FTP credentials to install plugins

#11
We had the same problem as part of a bigger problem. The suggested solution of

define('FS_METHOD', 'direct');

hides that window but then we still had problems with loading themes and upgrades etc. It is related to permissions however in our case we fixed the problem by moving from **php OS vendor mod_php** to the more secure **php OS vendor FastCGI application**.
Reply

#12
I did a local install of WordPress on Ubuntu 14.04 following the steps outlined [here][1] 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.


[1]:

[To see links please register here]


Hope this one helps to anyone!
Reply

#13
There's a lot of similar responses to this question, but none of them fully touch on the root cause. [Sebastian Schmid's][1] comment on the original post touches on it but not fully. Here's my take as of 2018-11-06:

**Root Cause**

When you try to upload a plugin through the WordPress admin interface, WordPress will make a call over to a function called "get_filesystem_method()" (ref: [/wp-admin/includes/file.php:1549][2]). This routine will attempt to write a file to the location in question (in this case the plugin directory). It can of course fail here immediately if file permissions aren't setup right to allow the WordPress user (think the user identity executing the php) to write the file to the location in question.

If the file can be created, this function then detects the file owner of the temporary file, along with the file owner of the function's current file (ref: [/wp-admin/includes/file.php:1572][3]) and compares the two. If they match then, in WordPress's words, "WordPress is creating files as the same owner as the WordPress files, this means it's safe to modify & create new files via PHP" and your plugin is uploaded successfully without the FTP Credentials prompt. If they don't match, you get the FTP Credentials prompt.

**Fixes**

1. Ensure the plugin directory is writable by the identity running your php process.
2. Ensure the identity that is running your php process is the file owner for either:

a) All WordPress application files, or... <br/>
b) At the very least the /wp-admin/includes/file.php file

**Final Comments**

I'm not overly keen on specifically applying file ownership to the file.php to work around this issue (it feels a tad hacky to say the least!). It seems to me at this point that the WordPress code base is leaning towards having us execute the PHP process under the same user principal as the file owner for the WordPress application files. I would welcome some comments from the community on this.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#14
I was facing the same problem!
I've added the code below in wp-config.php file (in any line) and it's working now!

define('FS_METHOD', 'direct');
Reply

#15
If during installation of a plugin, Wordpress asks for your hostname or FTP details.
Then follow these steps:

Login to your server and navigate to **/var/www/html/wordpress/**.
Open wp-config.php and add this line after define(‘DB_COLLATE’)

define('FS_METHOD', 'direct');

If you get "Could not create directory" error. Give write permissions to your wordpress directory in recursive as

chmod -R go+w wordpress

NOTE. For security, revoke these permissions once you install a plugin as

chmod -R go-w wordpress

Reply

#16
define('FS_METHOD', 'direct');


Add this to wp-config.php

If the issue still persist , you can try setting permission of plugin folder to 755
Or in linux you can set it by this command

Chmod -R 755

Reply

#17
For me the the process that solved, to be able to work on my localhost using Ubuntu, was:
*(of course you must replace myUser by your user, `whoami` show it for you if you dont know)*

- Include myself on www-data group (to be able to access and edit files without sudo):

sudo usermod -aG www-data myUser

- Set myself and this group as files owners:

sudo chown -R myUser:www-data /var/www/html


- Set a major permission for the group (the group must write too):

sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;

- Then add this line on config.php

define('FS_METHOD', 'direct');
Reply

#18
Changing the ownership of the files worked *but* only after I logged out of my wordpress website and logged in again. I also restarted the Apache server, but that may not be necessary.
Reply

#19
Specific Case and Solution

- Good answers above. Especially Matt Woodward (

[To see links please register here]

). Will be sharing a specific case and solution.
- WordPress is prompting you for your FTP credentials because the file permissions are incorrect for your WordPress setup.

**PROBLEM = MANUALLY COPYING WORDPRESS FILES**

I used rsync to copy over wordpress files from one cpanel with wordpress to another.

As I executed the rsync as "root" user, the copied files (but not directories!) got assigned to user "root".


**FIX YOUR FILE PERMISSIONS**

This will find all incorrectly assigned files. Check the list. If wordpress php files are among them, you have your problem.

find /home/yourcpanel/www -user root -printf "type="%Y/"depth="%d\ \ %u\:%g\ \ %p\\n


Now assign files to the correct user and group. In this case the cpanel name "*yourcpanel*" was the correct user. It might be different in your case. Check your SSH user, for example.

find /home/yourcpanel/www -type f -user root -group root -printf "type="%Y/"depth="%d\ \ %u\:%g\ \ %p\\n -exec chown yourcpanel:yourcpanel {} \;
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through