[英]FOSUserBundle Symfony 2.6.7 - PHP Fatal Error: cannot redeclare class
unfortunately the porject I'm working on is not public because it is an Intranet. 不幸的是,我正在研究的对象不是公开的,因为它是一个Intranet。 So I will do my very best to describe my problem and make it easy to answer.
因此,我将尽我所能描述问题并使其易于回答。
I have a clean Symfony 2.6 installation. 我有一个干净的Symfony 2.6安装。 I have installed FOSUserBundle (current Version) by using composer.
我已经使用composer安装了FOSUserBundle(当前版本)。 I followed the instructions in the documentation on git hub and one step before I finished my work successful, I got this message:
我按照git hub上的文档中的说明进行操作,然后在成功完成工作前一步,我收到了以下消息:
(Console) (安慰)
C:\Development\Webserver\htdocs\Intranet>php app/console doctrine:schema:update --force
PHP Fatal error: Cannot redeclare class Intranet\Bundle\UserBundle\Entity\User in C:\Development\Webserver\htdocs\Intranet\src\Intranet\Bundle\UserBundle\Entity\User.p
hp on line 17
Fatal error: Cannot redeclare class Intranet\Bundle\UserBundle\Entity\User in C:\Development\Webserver\htdocs\Intranet\src\Intranet\Bundle\UserBundle\Entity\User.php on
line 17
[2015-05-22 15:29:22] php.EMERGENCY: Fatal Compile Error: Cannot redeclare class Intranet\Bundle\UserBundle\Entity\User {"type":64,"file":"C:\\Development\\Webserver\\h
tdocs\\Intranet\\src\\Intranet\\Bundle\\UserBundle\\Entity\\User.php","line":17,"level":-1,"stack":[]}
This is my User.php 这是我的User.php
// src/Intranet/Bundle/UserBundle/Entity/User.php
namespace Intranet\Bundle\UserBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
/**
* User
*/
class User extends BaseUser
{
public function __construct()
{
parent::__construct();
}
}
The namespace is correctly written and I cannot find any other mistakes, issues or anything. 名称空间已正确编写,我找不到任何其他错误,问题或其他任何东西。 Until now I'm quite desperate and I hope that someone could help me.
到现在为止,我非常绝望,希望有人能帮助我。
Thanks ahead for reading and trying to help. 感谢您的阅读和尝试提供帮助。 Kind regards - Peter
亲切的问候-彼得
您可能已经在某处声明了User类,您可以尝试在项目中执行“ User类”搜索
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.