当我从app_dev.php
切换到app.php
时,会出现这种情况。
Apache日志:
[:error] [pid 2729] [client 192.168.77.11:50643] PHP Fatal error: Uncaught TypeError: Return value of ProxyManager\\Configuration::setGeneratorStrategy() must be an instance of ProxyManager\\void, none returned in /var/www/dvm/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php:124\nStack trace:\n
#0 /var/www/dvm/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php(37): ProxyManager\\Configuration->setGeneratorStrategy(Object(ProxyManager\\GeneratorStrategy\\EvaluatingGeneratorStrategy))\n
#1 /var/www/dvm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(628): Symfony\\Bridge\\ProxyManager\\LazyProxy\\Instantiator\\RuntimeInstantiator->__construct()\n
#2 /var/www/dvm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(577): Symfony\\Component\\HttpKernel\\Kernel->getContainerBuilder()\n
#3 /var/www/dvm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(486): Symfony\\Component\\HttpKernel\\Kernel->buildContainer()\n
#4 /var/www/dvm/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kerne in /var/www/dvm/vendor/ocramius/proxy-manager/src/ProxyManager/Configuration.php on line 124
我在http://symfony.com/doc/current/deployment.html中做了所有事情 我做错了什么?
<小时/> 修改
答案 0 :(得分:1)
我已经解决了在composer.json上设置php版本的相同问题:
"config": {
"platform": {
"php": "7.0.18"
},
}
然后作曲家根据php版本更新包。
答案 1 :(得分:-1)
您使用的是PHP 7.0,但安装了ocramius/proxy-manager
版本2.1.x,需要PHP 7.1。
有两种解决方案: