What to do when WordPress 2.8+ asks for connection info to upgrade a plugin

I was getting this when trying to upgrade a plugin automatically within WordPress:

Normally this would be a filesystem permission error. You have to make sure the wp-content/plugins folder is owned by the user apache is running as. However, that didn’t change a thing.

Further googling revealed that I needed to add this constant in my wp-config.php file:

define('FS_METHOD', 'direct');
Written on January 14, 2010