0

I have an error when deploying manually my symfony project into my server. I can't do any console command even cache:clear. I have used the :

php app/console cache:clear --no-warmup
PHP Notice:  Undefined index: argv in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 57
PHP Warning:  array_shift() expects parameter 1 to be array, null given in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 61
PHP Warning:  array_shift() expects parameter 1 to be array, null given in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 294
PHP Warning:  Invalid argument supplied for foreach() in /app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php on line 269
Status: 500 Internal Server Error
X-Powered-By: PHP/5.3.8-pl0-gentoo
cache-control: no-cache
date: Fri, 10 Feb 2012 15:31:08 GMT
content-type: text/html; charset=UTF-8

<br />
<b>Notice</b>:  Undefined index: argv in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>57</b><br />
<br />
<b>Warning</b>:  array_shift() expects parameter 1 to be array, null given in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>61</b><br />
<br />
<b>Warning</b>:  array_shift() expects parameter 1 to be array, null given in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>294</b><br />
<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/app/vendor/symfony/src/Symfony/Component/Console/Input/ArgvInput.php</b> on line <b>269</b><br />
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="robots" content="noindex,nofollow" />
        <title>Whoops, looks like something went wrong.</title>
        <style>
            /* Copyright (c) 2010, Yahoo! Inc. All rights rese

I have printed the app/logs/dev.log error:

[2012-02-10 13:04:58] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
[2012-02-10 13:04:58] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\Security\Http\Firewall\ContextListener::onKernelResponse". [] []
[2012-02-10 13:04:59] security.DEBUG: Write SecurityContext in the session [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\SecurityBundle\EventListener\ResponseListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\CacheListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse". [] []
[2012-02-10 13:04:59] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse". [] []

I have no idea and no description in the web

Please help me

Thanks Sam

5
  • Are you doing this from a console window? Seems a bit bizarre. When happens if you just do: php app/console? And if that blows up then make a simple hello.php file and make sure it runs. I suppose it's possible that something in your php.ini might be kicking in. Commented Feb 11, 2012 at 0:24
  • I have tried a php app/console and i have the same probkem... I have made à php file which contains php version fubction and it works... Commented Feb 11, 2012 at 11:34
  • And you are running this directly from a console window and not through a web page? Commented Feb 12, 2012 at 13:12
  • Hi cerad. I'm running this directly from a console window Commented Feb 12, 2012 at 17:15
  • I have found thé solution.... I have totally dessinstall the server and use a debian one... Now it works!! Capifony it is so cool :) Commented Feb 16, 2012 at 7:14

3 Answers 3

6

Here is an issue track which have brought some light to me: https://github.com/symfony/symfony/issues/3323

After reading that I researched and I've found that the problem raises in PHP CLI configuration (php.ini file). The register_argc_argv directive must be enabled:

register_argc_argv=On

Or if you cannot modify the php.ini file, you can change it in time execution pasing as an argument to php:

php -d register_argc_argv=On your_script.php
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! That solved my problem. I was getting a ContextErrorException caused by Invalid argument supplied for foreach() in Symfony/Component/Console/Input/ArgvInput.php line 283
2

did you try :

php-cli app/console cache:clear

instead of :

php app/console cache:clear

Comments

-4

I have solved my problem. I have reinstall my server and now I use a debian one in order to use a gentoo distribution.

I have now no problem.

It works perfectly...

Thanks for all

1 Comment

That is a very unhelpful answer, what if you are here trying to troubleshoot the problem on Debian? Clearly something else is amiss.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.