2013-07-10 26 views
3

我试图安装的Symfony2没有厂商和我不断收到以下错误运行app_dev.php时:的Symfony2自动加载找到的文件,但没有找到类

RuntimeException: The autoloader expected class "Symfony\Component\EventDispatcher\Event" to be defined in file "/var/www/caremonk/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Event.php". The file was found but the class was not in it, the class name or namespace probably has a typo. 

我已经通过安装在正确的文件和供应商: PHP composer.phar更新 PHP composer.phar安装

我也检查了Symfony2的抱怨有关文件,该文件的内容是:

<?php 

/* 
* This file is part of the Symfony package. 
* 
* (c) Fabien Potencier <[email protected]> 
* 
* For the full copyright and license information, please view the LICENSE 
* file that was distributed with this source code. 
*/ 

namespace Symfony\Component\EventDispatcher; 

/** 
* Event is the base class for classes containing event data. 
* 
* This class contains no event data. It is used by events that do not pass 
* state information to an event handler when an event is raised. 
* 
* You can call the method stopPropagation() to abort the execution of 
* further listeners in your event listener. 
* 
* @author Guilherme Blanco <[email protected]> 
* @author Jonathan Wage <[email protected]> 
* @author Roman Borschel <[email protected]> 
* @author Bernhard Schussek <[email protected]> 
* 
* @api 
*/ 
class Event 
{ 
    // Some more code 
} 

这是一个标准的symfony2类,我没有碰过,所以我有点迷失在我需要做的事情上。我怎样才能摆脱这个错误?

回答

4

昨晚出现类似问题。禁用和重新启用APC似乎有诀窍。

+0

我刚刚重新启动apache,无论出于何种原因,都做了伎俩。你的建议让我这么做,谢谢! –

+0

太棒了!一些更多的谷歌搜索导致这个答案http://stackoverflow.com/questions/3144350/do-we-need-to-restart-apache-apc-after-new-version-deployment-of-app – mattexx