Are you on shared hosting by any chance? If so, this may help you.
I've just spent most of a day messing around with Magento Connect Manager 2.0 trying to get it working with the FTP option. I couldn't even get it to save any of my settings on the settings tab, it just kept reverting to the defaults.
I eventually tracked the problem down to Magento's insistence on using sys_get_temp_dir to determine the temporary directory. This doesn't generally work on shared hosting, since you won't have write access to /tmp. Unfortunately, there's no errors generated when it fails, and Magento just carries on but doesn't save or load the Magento Connect FTP settings. I had a similar problem elsewhere in the core code before.
I've created a temporary folder under my main installation at /var/tmp, and made it world-writable.
There's 11 places within /downloader and /lib/Mage which use this function to determine the temporary folder. These will need to be changed to point at wherever you decide to put your temp folder. I'm not sure if all of them need to be changed, or exactly what they all do, but I changed them to be on the safe side. Details at the end of the post. Line number are approximate, but just search for sys_get_temp_dir in each file.
Once you've made the changes you'll need to ensure that the following folders are world writable, recursively:
/var/package/tmp/
/downloader/.cache
/media
The plus side of the FTP option is that the Magento root no longer needs to be writable.
Any of the changes below may break Magento Connect, particularly the ones marked with **. I've done them , and run one install of a module which seemed to go OK, but I make no guarantees about them. They're also a bit messy in some places, I'm sure they could be improved - there may be a better way of getting magento_root in some cases. Be careful, there are similarly named files in different subfolders.
Still, hope they might save someone going through the nuisance I had today. Would be a great help if Varien would just write their own tmpDir function and let you specify a temp folder in the admin, save a ton of hassle. Ah well.
downloader\lib\Mage\Connect\Config.php, line 207:
// $tempFile = tempnam(sys_get_temp_dir(),'config');
$tempFile = tempnam($this->magento_root. '/var/tmp/' ,'config');
downloader\lib\Mage\Connect\Command\Registry.php, line 315:
//$localXml = tempnam(sys_get_temp_dir(),'package');
$magento_root = dirname(dirname(__FILE__)) . '/../../../..';
$localXml = tempnam($magento_root. '/var/tmp/' ,'package');
downloader\lib\Mage\Connect\Loader\Ftp.php, line 107:
// $tmpDir = sys_get_temp_dir();
$magento_root = dirname(dirname(__FILE__)) . '/../../../..';
$tmpDir = $magento_root . '/var/tmp/';
downloader\Maged\Controller.php, 869**:
//$tempFile = tempnam(sys_get_temp_dir(),'maintenance');
$tempFile = tempnam($config->__get('magento_root') . '/var/tmp/' ,'maintenance');
This one is needed in order to save your config changes:
downloader\Maged\Model\Connect.php, 404:
//$tempFile = tempnam(sys_get_temp_dir(),'config');
$tempFile = tempnam($configObj->magento_root. '/var/tmp/' ,'config');
downloader\Maged\Model\Config\Abstract.php, 88**:
// $tempFile = tempnam(sys_get_temp_dir(),'configini');
$magento_root = dirname(dirname(__FILE__)) . '/../../..';
$tempFile = tempnam($magento_root. '/var/tmp/' ,'configini');
downloader\lib\Mage\Connect\Packager.php - the remaining 5 changes are in this file.
Line 96 - I believe this was the one needed to load your config changes onto the settings screen:
// $tempConfigFile = tempnam(sys_get_temp_dir(),'conf');
$magento_root = dirname(dirname(__FILE__)) . '/../../..';
$tempConfigFile = tempnam($magento_root . '/var/tmp/' ,'conf');
line 111:
// $tempCacheFile = tempnam(sys_get_temp_dir(),'cache');
$magento_root = dirname(dirname(__FILE__)) . '/../../..';
$tempCacheFile = tempnam($magento_root . '/var/tmp/' ,'cache');
Around 135, before the if statement:
$magento_root = dirname(dirname(__FILE__)) . '/../../..';
then in both the if and the else parts:
// $configFile=tempnam(sys_get_temp_dir(),'conf');
$configFile = tempnam($magento_root. '/var/tmp/' ,'conf');
158:
//$tempConfigFile = tempnam(sys_get_temp_dir(),'conf_');
$magento_root = dirname(dirname(__FILE__)) . '/../../..';
$tempConfigFile = tempnam($magento_root. '/var/tmp/' ,'conf_');