我正在尝试在服务器上部署我的代码。
我按照以下步骤操作:
但是我收到了这个错误:
Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException' with message 'You have requested a non-existent parameter "kernel.debug".' in /home/public_html/demo/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:106 Stack trace: #0 /home/public_html/demo/app/bootstrap.php.cache(1959): Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->get('kernel.debug') #1 /home/public_html/demo/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php(85): Symfony\Component\DependencyInjection\Container->getParameter('kernel.debug') #2 /home/public_html/demo/app/bootstrap.php.cache(2562): Symfony\Bundle\FrameworkBundle\FrameworkBundle->build(Object(Symfony\Component\DependencyInjection\ContainerBuilder)) #3 /home/public_html/demo/app/bootstrap.php.cache(2542): Symfony\Component\HttpKernel\Kernel->prepareContainer(Object(Symfony\Component\DependencyInjection\ContainerBuilde in /home/public_html/demo/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php on line 106
答案 0 :(得分:1)
如您所见,此错误正在bootstrap.php.cache
中抛出。
Symfony使用引导文件来提高类加载性能,如文档here所述。但是,您可能会从开发环境中复制此文件,并且尚未为生产重新生成。
您需要通过运行composer install
或直接运行构建脚本来重新生成此文件:php ./vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php