我有我的所有网址的网站这个回报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