2016-03-14 28 views
1

我最近開始學習symfony 2.8並嘗試在本地主機上設置第一頁。基於本教程配置我的包後,但是:https://www.youtube.com/watch?v=S9aQxvEAdcE&list=PLp9j56Yo8a6aWJhLyggonvP7b8vIcYn5Q&index=3CheckExceptionOnInvalidReferenceBehaviorPass.php中的ServiceNotFoundException第58行

我得到這個錯誤:

ServiceNotFoundException in CheckExceptionOnInvalidReferenceBehaviorPass.php line 58: 
The service "doctrine.orm.layout_entity_manager" has a dependency on a non-existent service "doctrine.orm.quote_strategy.layout". 
嘗試與本地主機ADRESS打開我的頁面時,

/ST /網絡/ app_dev.php

原因我問的是,這是無法找到關於這個特定問題的任何事情,並不知道這些服務是關於什麼。如果任何人有任何線索我做錯了或爲什麼會出現此錯誤,請與我分享。我不添加任何代碼,因爲我不太確定哪些文件可能是此錯誤的原因。在此先感謝

編輯:

我使用PHP風暴位於C:\wamp64\www\st(啓用symfony的插件和命令行工具)創建新的symfony項目

然後生成一個名爲MainBundle

我重新命名包DefaultController.phpMainBundle/ControllerMainController.php並將其中的等級更改爲MainController。 然後在app/Resources/views重命名默認文件夾layout,以及base.html.twiglayout.html.twig 然後填充自舉模板樹枝文件

然後換MainController.php到這一點:

<?php 

namespace MainBundle\Controller; 

use Symfony\Bundle\FrameworkBundle\Controller\Controller; 
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 

class MainController extends Controller 
{ 
    /** 
    * @Route ("/", name="home") 
    */ 
    public function indexAction() 
    { 
     return $this->render('MainBundle:Default:home.html.twig'); 
    } 
} 

然後在src/Resource/views/Defaul噸變化index.html.twig變成home.html.twig

src/MainBundle/Resources/config/routing.yml填入像這樣:

main: 
    resource: "@MainBundle/Controller/MainController.php" 
    prefix: /
    type: annotation 

加入GitHub的項目鏈接https://github.com/marras1/st

+0

你會採取什麼行動來產生這個錯誤?爲什麼不把所有文件轉儲到github項目並從這裏鏈接到它?或者嘗試將您的代碼縮小到展示問題的最小事物,然後在此處發佈。沒有看到任何代碼就很難調試你的問題。 –

+0

@WillSheppard編輯了更多的細節問題,並添加github鏈接發佈。希望能夠明白理解 – marras

回答

0

好了,所以我不太清楚是什麼做的魔力,但我在這裏發現了這個想法:Symfony2 post-update-cmd gives "An error occurred when generating the bootstrap file"
刪除項目的/ bin和/供應商的文件夾。然後做一個作曲家安裝(或者如果你沒有安裝composer,則使用php composer.phar安裝)。另外我跑了php composer.phar update doctrine/mongodb-odm doctrine/mongodb-odm-bundle,整個系統現在看起來工作得很好。

相關問題