Symfony2 is not a valid entity or mapped superclass

I have a symfony2 application on my local computer with ubuntu and it works well, but it does not work on a server with CentOS and Cpanel, I got this error:

The class "Propa \ PageBundle \ Entity \ Page" is not a valid entity or the super class is mapped.

CRITICAL - Doctrine \ ORM \ Mapping \ MappingException: Class "Propa \ PageBundle \ Entity \ Page" is not a valid entity or mapped super class. (uncaught exception) in / home / estudi 83 / domains / serverprova.com.es / propa / vendor / doctrine / orm / lib / Doctrine / ORM / Mapping / MappingException.php line 216

I prove:

$page=$em->getRepository('PropaPageBundle:Page')->findOneBy(array('codi'=>'0001'));

And get this error: Unknown Entity namespace alias 'PropaPageBundle'.

And I prove:

 $page=$em->getRepository('Propa\PageBundle\Entity\Page')->findOneBy(array('codi'=>'0001'));

And get the same error: Class "Propa\PageBundle\Entity\Page" is not a valid entity or mapped super class.

This is the object:

<?php
namespace Propa\PageBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Propa\PageBundle\Util;
use Gedmo\Mapping\Annotation as Gedmo;




/**
 * @ORM\Entity(repositoryClass="Propa\PageBundle\Repository\PageRepository")
 * @Gedmo\TranslationEntity(class="Propa\PageBundle\Entity\Translation\PageTranslation")
 * @ORM\HasLifecycleCallbacks
 * @Vich\Uploadable
 */

class Page {

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    protected $id;

I have proven:

auto_mapping: true

and

auto_mapping: false
mappings:
    PageBundle: ~

But always get the same error.

What can I do?

UPDATE: eAccelerator symfony2, eAccelerator APC !!

0
1

, . eAccelerator, , , Doctrine. , eAccelerator ! APC, .

apc vs eaccelerator vs xcache


http://you.site.name/config.php

, , .

.


, SO " XXX "

https://github.com/symfony/symfony/issues/4554


$page=$em->getRepository('PageBundle:Page')->findOneBy(array('codi'=>'0001'));

 $page=$em->getRepository('PropaPageBundle:Page')->findOneBy(array('codi'=>'0001'));

 $page=$em->getRepository('Propa\PageBundle\Entity\Page')->findOneBy(array('codi'=>'0001'));

, .

+2

All Articles