I'm trying to update my magento from command line. I changed mage permissions to 755

 chmod 755 mage

Then I launched mage-setup

./mage mage-setup

But when I try other commands the following error occurs

Please initialize Magento Connect installer by running:
./mage mage-setup

2 Answers 2


I think the issue is that you are missing one part of the mage-setup command. Try using the command ./mage mage-setup .. Notice the . at the end, this should tell the setup to use the current directory.

After this is done you can continue the upgrade with the normal commands.

./mage config-set preferred_state stable
./mage sync
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force

In "mage" file, replace/uncomment #MAGE_PHP_BIN="php"

with: MAGE_PHP_BIN="php-cli"

The mage console require php in cli mode, and a lot of time "php" point to cgi and it will stop working.

If you don't have php cli version you can always modify mage.php. putting:

if (!defined('STDIN'))
    define('STDIN', fopen('php://stdin', 'r'));
if (!defined('STDOUT'))
    define('STDOUT', fopen('php://stdout', 'w'));
if (!defined('STDERR'))
    define('STDERR', fopen('php://stderr', 'w'));

anywhere before: if (defined('STDIN') && defined('STDOUT') && (defined('STDERR'))) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.