Doctrine with eAccelerator issue in zend framework 2 website

149 Views Asked by At

The problem that I am getting with the website bulid in zend framework2 with Doctrine 2 as ORM.It works perfect on local server .But its giving me error when deployed on production live server.below is the error

"Class X is not a valid entity or mapped super class"

Can anyone have any solution for it.

1

There are 1 best solutions below

0
WildlyInaccurate On

I covered this in a blog post a while back. Basically, this is happening because eAccelerator is stripping out docblock annotations as an "optimisation". The problem is that Doctrine is relying on these annotations to map your entities.

There are two possible solutions:

  1. Don't use eAccelerator. There are much better opcache tools available e.g. APC or PHP's built-in OPcache (PHP 5.5+).
  2. Disable this behaviour in eAccelerator. You can do this by compiling eAccelerator with the --with-eaccelerator-doc-comment-inclusion flag, or use a newer version of eAccelerator which disables this behaviour by default.