install and update WordPress plugins automatically - without providing FTP access

thedighubs

Member
Nov 21, 2024
154
15
41
install and update WordPress plugins automatically - without providing FTP access

good day dear friends

well i hope that this goes to the correct sub-forum. If not plz set me straight: ( i hope thast you can help me witht this wp-question)

to begin' I am using WordPress on a server which only uses SFTP using an SSH key.
well there are options to auto-update the the plugins and the wordpress itself.

This is nice and generally a cool feature:
that said: i want to install and upgrade plugins, but it appears that we are required to enter the FTP login to install the plugins.

where to do that?:
are there any other methods to go round this - eg. to add some lines to the configuration file!?
In other words: Is there a way to install and upgrade plugins by any means - so that having WordPress handle the entire process?

Look forward to hear from you

regards

again.



Update Well I think that I found out some more:

The question is: How to get updates of plugin, theme etc processed through the dashboard.

After some research I have found out a interesting article:


As stated before none of the perm fixes work anymore. You need to change the perms accordingly AND put the following in your wp-config.php:


define('FS_METHOD', 'direct');


Auto o update steering WordPress will only prompt you for your FTP connection information while trying to install plugins or a WordPress update if it cannot write to /wp-content directly. Otherwise, if your web server has write access to the necessary files, it will take care of the updates and installation automatically. This method does not require you to have FTP/SFTP or SSH access, but it does require your to have specific file permissions set up on your webserver.


It will try various methods in order, and fall back on FTP if Direct and SSH methods are unavailable.



WordPress will try to write a temporary file to your /wp-content directory. If this succeeds, it compares the ownership of the file with its own uid, and if there is a match it will allow you to use the 'direct' method of installing plugins, themes, or updates.


Now, if for some

', 'ssh', 'ftpext' or 'ftpsockets' and it will use that method. Keep in mind that if you set this to 'direct', but your web user (the username under which your web server runs) does not have proper write permissions, you will receive an error.
In summary, if you do not want to (or you cannot) change permissions on wp-content so your web server has write permissions, then add this to your wp-config.php file:


define('FS_METHOD', 'direct)

reason you do not want to rely on the automatic check for which filesystem method to use, you can define a constant, 'FS_METHOD' in your wp-config.php file, that is either 'direct

Well I think that I have to add the FS - Method to the configuration to get the update process working..



What do you think about this ideas that were discussed at Stack exchange?



Look forward to hear from you
 
Last edited: