我有我的所有網址的網站這個回報symfony的錯誤:
「ClassNotFoundException的:試圖加載類‘在C’從命名空間‘學說\包\ FixturesBundle’DoctrineFixturesBundle:\開發\ Apache2.4.6 \ htdocs中\ mysite的\程序\ AppKernel.php線23.你需要從另一個命名爲「用」嗎?「
ClassNotFoundException的:試圖加載類「DoctrineFixturesBundle」
當我修改config.yml此錯誤出現(部分學說orm)解決別人的問題,但不能解決。事實上,我在這個文件中更改並重新運行我的網站,但現在無法正常運行。我隨時隨地都有這個錯誤。
複製我的代碼在這裏,但在簡單的問題回答:
- 你已經在AppKernel.php加入這一行:$束[] =新學說\包\ FixturesBundle \ DoctrineFixturesBundle(); ? 迴應:是的
- 你有安裝夾具捆綁?迴應:是的
- 你有安裝/更新和自更新作曲家嗎?回覆:是
- 您是否有裝入數據庫的裝置?迴應:是(它完美運行)
- 你有清理緩存嗎?回覆:是的
所有我的燈具引擎運行正確之前,這就產生錯誤。
AppKernel.php
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
composer.json
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"doctrine/orm": "2.4.2",
"doctrine/doctrine-bundle": "~1.2",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "~2.3",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~2.3",
"sensio/framework-extra-bundle": "~3.0",
"sensio/generator-bundle": "~2.3",
"incenteev/composer-parameter-handler": "~2.0",
"doctrine/doctrine-fixtures-bundle": "dev-master"
},
config.yml
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver, add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
感謝您的寶貴幫助
我也是,我有這個問題,我認爲這是由從windows複製/ psting代碼到unix平臺(如Ubuntu)造成的。對於我來說,每一次,我從Windows複製代碼到unix,我得到這個錯誤。 – skonsoft
我不知道你的評論是否詳細描述了我的實際問題的原因,但是我已經在你說的同一時間用linux和windows查看工作中的錯誤。 – darkomen