Composer does not throw Uncaught 'ErrorException' exception with message 'Undefined index: argv'

As soon as I download the composer to my remote web host. I am trying to run the command "php composer.phar install"

As soon as I run this command, as the documentation says, I get errors like tomorrow.

nwrepai1@ ******** [~/public_html]# php composer.phar install Content-type: text/html <br /> <b>Fatal error</b>: Uncaught exception 'ErrorException' with message 'Undefined index: argv' in phar:///home3/nwrepai1/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php:57 Stack trace: #0 phar:///home3/nwrepai1/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php(57): Composer\Util\ErrorHandler::handle(8, 'Undefined index...', 'phar:///home3/n...', 57, Array) #1 phar:///home3/nwrepai1/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Application.php(98): Symfony\Component\Console\Input\ArgvInput-&gt;__construct() #2 phar:///home3/nwrepai1/public_html/composer.phar/src/Composer/Console/Application.php(74): Symfony\Component\Console\Application-&gt;run(NULL, Object(Symfony\Component\Console\Output\ConsoleOutput)) #3 phar:///home3/nwrepai1/public_html/composer.phar/bin/composer(37): Composer\Console\Application-&gt;run() #4 /home3/nwrepai1/public_html/composer.phar(14): require('phar:///home3/n...') #5 {main} thrown in <b>phar:///home3/nwrepai1/public_html/composer.phar/vendor/symfony/console/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>57</b><br /> nwrepai1@ ********* [~/public_html]# 

Is there something I am missing on this?

+5
source share
3 answers

You need to make sure register_argc_argv=on set in your php.ini for the CLI.

+12
source

I had the same problem on my shared hosting. This did not work after I set register_argc_argv = On.

But when I tried "php-cli composer.phar" instead of "php composer.phar" in the shell, it worked.

+14
source

php -d register_argc_argv=On composer.phar

0
source

All Articles