I did so much R&D about installing and updating the wordpress plugin without using ftp access. I got very nice trick to solve this issue. When you are using the shared hosting or VPS server for wordpress site hosting. You always face issue for installing the wordpress plugin or wordpress theme. It issue happen when you do the the wordpress updation. Using following simple steps you can install the wordpress plugins and themes without giving the ftp access.
update wordpress plugins without ftp access
I always did the wordpress plugins and theme updation. So every time providing the ftp credentials are really panic. So I am always using following steps for doing wordpress up-gradation.
First you need to add the following code in your wp-config.php file.
define('FTP_USER', 'username'); define('FTP_PASS', 'mypassword'); define('FTP_HOST', '192.168.2.132'); define('FTP_SSL', false);
But this is old idea. If you dont want to add the ftp access in wp-config.php file then Just add the following line wp-config.php file.
define('FS_METHOD', 'direct');
Note: You need to give 755 permission to wp-content folder. Create the upgrade folder in wp-content folder.
If still you are facing issue then give 777 permission to all wp-content folder.
For permission use following command
cd your_wordpress_directory sudo chown -R www-data wp-content sudo chmod -R 755 wp-content
More information:
WordPress will try to write a temporary file to your /wp-content
directory. If this succeeds, it compares the ownership of the file with it’s 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 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' 'ssh', 'ftpext' or 'ftpsockets'
and it will use method. Keep in mind that if you set this to ‘direct’ but your web user (the username under which your webs server runs) does not have proper write permissions, you will receive an error.
great hack of wordpress..nice trick.