Symfony2 - generate:bundle 命令抛出注意:未定义的变量:输出

Symfony2 - generate:bundle command throws Notice: Undefined variable: output

我是 Symfony2 框架的新手,正在关注在线课程。但是,当我达到在 CMD 中设置捆绑包时,重复出现以下消息。

Configuration format (annotation, yaml, xml, php) [annotation]: Notice: Undefined variable: output

有没有人遇到过类似的问题? (见屏幕截图)

出现此错误是因为您在 php.ini 中禁用了 exec and/or shell_exec。要调试 运行 以下命令之一:

# linux/osx
php -i | grep 'disable_functions'
# windows
php -i | findstr 'disable_functions'

如果 disable_functions ini 指令包含 execshell_exec ...

disable_functions=exec,passthru,shell_exec,system,proc_open

... 按照 this answer.

中的建议,将它们从 CLI php.ini 中的 disable_functions 中删除