私は Symfony 2 を使用しており、FOSUserBundleを正常に構成しました。
私のアプリケーションは、本番モードと開発モードの両方の Windows マシンで正常に動作します
しかし、Linux マシンに展開すると、開発モードでは問題なく動作しますが、運用モードでは空白のページが表示されます。エラーログファイルを確認すると、次のエラーがあります。
request.CRITICAL: Doctrine\ORM\Mapping\MappingException: Class \Entity\User is not a
valid entity or mapped super class. (uncaught exception)
request.CRITICAL: Exception thrown when handling an exception
(Doctrine\ORM\Mapping\MappingException: Class \Entity\User is not a valid entity or
mapped super class.) [] []
私の User Entity クラスを見てください:
/**
* @ORM\Entity(repositoryClass="\Repository\UserRepository")
* @ORM\Table(name="user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length="255")
*
* @Assert\NotBlank(message="Please enter your name.", groups={"Registration", "Profile"})
* @Assert\MinLength(limit="3", message="The name is too short.", groups={"Registration", "Profile"})
* @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"})
*/
protected $name;
/**
* @ORM\Column(type="date", length="255", nullable=true)
*
* @Assert\NotBlank(message="Please select your Date Of Birth.", groups={"Registration", "Profile"})
*/
protected $dob;
/**
* @ORM\Column(type="string", length="255")
*
* @Assert\NotBlank(message="Please select your Date Of Birth.", groups={"Registration", "Profile"})
*/
protected $gender;
/**
* Override $email so that we can apply custom validation.
*
* @Assert\Email(groups={"AppRegistration"})
*/
protected $email;
/**
* @var string $firstName
*
* @ORM\Column(name="first_name", type="string", length=20, nullable=true)
*/
protected $firstName;
/**
* @var string $lastName
*
* @ORM\Column(name="last_name", type="string", length=20, nullable=true)
*/
protected $lastName;
/**
* @var datetime $createdAt
*
* @ORM\Column(name="created_at", type="datetime", nullable=true)
*/
protected $createdAt;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $facebookID;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $twitterID;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $twitter_username;
/**
* @ORM\Column(type="string", length="255", nullable=true)
* @var string
*/
protected $image_path;
/**
* @ORM\Column(name="home_town",type="string", length="255", nullable=true)
* @var string
*/
protected $homeTown;
/**
* @ORM\Column(name="location",type="string", length="255", nullable=true)
* @var string
*/
protected $location;
/**
* @ORM\Column(name="interest",type="string", length="255", nullable=true)
* @var string
*/
protected $interest;
/**
* @ORM\Column(name="friend",type="string", length="255", nullable=true)
* @var string
*/
protected $friend;
/**
* @var smallint $age
*
* @ORM\Column(name="age", type="smallint", nullable=true)
*/
protected $age;
/**
* @var string $country
* @ORM\ManyToOne(targetEntity="Country", inversedBy="user")
* @ORM\JoinColumn(name="country_id", referencedColumnName="id")
* @ORM\Column(name="country_id", type="string", length=25, nullable=true)
*/
protected $countryId;
/**
* @ORM\OneToMany(targetEntity="ProfileViewer", mappedBy="viewer")
*/
protected $viewers;
..................