Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Once I download composer to my remote web host. I try to run the command "php composer.phar install"

Once I run this command like it says in the documentation, I get errors like no 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 anything that I am missing on this?

like image 246
Ryahn Avatar asked Jan 01 '13 07:01

Ryahn


2 Answers

I had the same issue on my shared hosting. It didn't 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.

like image 83
Zhou Yuan Avatar answered Oct 04 '22 03:10

Zhou Yuan


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

like image 25
Joachim Isaksson Avatar answered Oct 04 '22 05:10

Joachim Isaksson