When installing plugins or upgrading a WordPress site it requires downloading some packages on the server. For this the wp-content folder must be writable by WordPress. Now when installing plugins WordPress will ask for the FTP credentials as follows (unless the direct method is specified):
I’ve seen in versions 3.x the direct method isn’t set by default. To bypass the FTP method we add the following line in the wp-config.php file.
define('FS_METHOD', 'direct');
WordPress can now download the plugin packages on the server, extract them and install automatically.