Symfony 生产服务器中的条令批注错误
我在生产服务器中有一个错误,该错误在我的本地主机中没有发生: 这个错误发生在本地,当时我试图用composer更新一些软件包,但没有解决它,我不得不重新安装symfony并再次上传所有内容,,并且仍然在发生 缓存已被清除,所以我猜这不是缓存 AppKernel.php App/config/routing.ymlSymfony 生产服务器中的条令批注错误,symfony,annotations,Symfony,Annotations,我在生产服务器中有一个错误,该错误在我的本地主机中没有发生: 这个错误发生在本地,当时我试图用composer更新一些软件包,但没有解决它,我不得不重新安装symfony并再次上传所有内容,,并且仍然在发生 缓存已被清除,所以我猜这不是缓存 AppKernel.php App/config/routing.yml 我也有类似的问题 解决后,使用require\u导入Sensio\Bundle\FrameworkExtraBundle\Configuration\Route类 require_on
我也有类似的问题 解决后,使用require\u导入Sensio\Bundle\FrameworkExtraBundle\Configuration\Route类
require_once __DIR__ . '/../vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Route.php';
可能是php版本?你能分享你的控制器和AppKernel.php代码吗?它们非常相似(我实际上不知道挤压是什么),Local:5.3.21/Server:5.3.3-7+squeeze15@skafandri,添加了一些代码。是否使用Sensio\Bundle\FrameworkExtraBundle\Configuration\Route导入;在控制器中?
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new MyProject\PanelBundle\MyProjectPanelBundle(),
new MyProject\ProductBundle\MyProjectProductBundle(),
new Front\SiteBundle\FrontSiteBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
/**
* Lists all MyEnt entities.
*
* @Route("/", name="my_ent")
* @Method("GET")
* @Template("MyProjectPanelBundle:MyEnt:index.html.twig")
*/
public function indexAction($ident)
{
front_site:
resource: "@FrontSiteBundle/Resources/config/routing.yml"
prefix: /
MyProject_product:
resource: "@MyProjectProductBundle/Resources/config/routing.yml"
prefix: /
MyProject_panel:
resource: "@MyProjectPanelBundle/Resources/config/routing.yml"
prefix: /
require_once __DIR__ . '/../vendor/sensio/framework-extra-bundle/Sensio/Bundle/FrameworkExtraBundle/Configuration/Route.php';