Symfony2:错误部署

时间:2012-02-10 15:39:03

标签: deployment symfony

将symfony项目手动部署到我的服务器时出错。我甚至无法执行任何控制台命令缓存:清除。我用过:

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

我打印了 app / logs / dev.log 错误:

[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". [] []

我在网上不知道也没有描述

请帮帮我

由于 萨姆

3 个答案:

答案 0 :(得分:6)

这是一个问题轨道,它给我带来了一些启示: https://github.com/symfony/symfony/issues/3323

阅读后我研究了一下,我发现问题在PHP CLI配置(php.ini文件)中引发。必须启用register_argc_argv指令:

register_argc_argv=On

或者如果你不能修改php.ini文件,你可以在时间执行中改变它作为php的参数:

php -d register_argc_argv=On your_script.php

答案 1 :(得分:3)

你试过了吗?

  

php-cli app / console cache:clear

而不是:

  

php app / console cache:clear

答案 2 :(得分:-4)

我已经解决了我的问题。我重新安装了我的服务器,现在我使用debian来使用gentoo发行版。

我现在没有问题。

完美无缺......

全部谢谢