Symfony2, Doctrine2 Fatal error: Call to a member function getMetadataFactory() on a non-object in

This problem meets me after upload my Symfony2 app from my laptop to production server. Then, when I try run app I get:

Symfony2, Doctrine2 Fatal error: Call to a member function getMetadataFactory() on a non-object in…

After lot of searching I found solution. In my case was eAccelerator on production server.

In default configuration eAccelerator remove comments (and – of course – annotations from Entity definition class) probably to speed execution code. This is a reason for this error.

You have two options: say good bay to eAccelerator or compile it with

--with-eaccelerator-doc-comment-inclusion=yes

switch.

So step by step second solution:

/usr/local/php5/bin/phpize

./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php5/bin/php-config --with-eaccelerator-doc-comment-inclusion=yes

make

make install

That`s it! Have a nice day 🙂

 

Incoming search terms:

  • call to a member function getmetadatafactory() on a non-object

Leave a Comment:

2 comments
Hans Rakers says 10 August 2012

This is the reason why i recently changed the compilation settings for eAccelerator to enable –with-eaccelerator-doc-comment-inclusion by default.

No official new release yet, but you can check out the current master branch on Github at http://eaccelerator.github.com/

Reply
admin says 10 August 2012

Thank you for the information. I’m waiting for the official release. Nice to see this project is alive!

Reply
Add Your Reply