在 Ubuntu 服务器上的环境中运行我的 symfony3 项目,prod
我收到以下错误:
"注意:未定义索引:data_collector/passed_options",
dev
如果我使用环境,则不会发生此错误。
我的自定义中引发了错误FormType
:
// src/MyBundle/Form/CustomType/MyCustomType.php:
class MyCustomType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options){
$builder->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event){....}
$form = $event->getForm();
$inheritedAttr = $form->getConfig()->getAttributes()['data_collector/passed_options']['attr']; //it crashes there
....
}
}
app_dev.php
我在生产 Ubuntu 服务器上编辑了我的文件(就像这里解释的那样),以便我可以使用这个命令在生产中进行测试:
php bin/console server:start [我的服务器的IP]:[自定义端口]
但是错误仍然没有在dev
环境中抛出。所以这不是我的开发机器的问题。
难道是环境$form->getConfig()->getAttributes()
中没有索引prod
?
有什么方法可以调试在prod
环境中发生但不在环境中发生的此类错误dev
?