Starting with Symfony2 - Troubleshooting number
@shakedko
IF AN EXPERT SAYS IT CAN'T BE DONE GET ANOTHER EXPERT.
- DAVID BEN-GURION

Starting with Symfony2 - Troubleshooting number

Introduction

So I decided to join the "club" and try Symfony2 finaly.

I have to say that I am not familiar with most of this framework and it's power but from what I saw and read till now it seems to be promising.

I am not going to describe much about Symfony2 as I think there is enough documentation out there regarding to that.

More than that, Symfony2 has a great documentation and examples which make everything straight forward.

Description

I was reading the Doctrine chapter in Symfony's book. While reading and trying the chapter's examples I was having some troubles with an annoying error:

Class "Acme\StoreBundle\Entity\Product" sub class of "" is not a valid entity or mapped super class.

The error occurred after trying the ORM Repository example.

Suggested Solution

I Googled the issue for sometime and found two available websites that were suggesting solutions for the above issue:

  1. http://wildlyinaccurate.com/eaccelerator-and-doctrine-2
  2. http://stackoverflow.com/questions/7820597/class-xxx-is-not-a-valid-entity-or-mapped-super-class-after-moving-the-class-i

One of the suggested solution was to make sure that eAccelerator is not running as it might cause problems.

I checked my PHP modules (php -m | grep -i "eaccelerator") and I found out that I was using it and removed it (from php.ini or php.d/eaccelerator.ini).

After doing that I restarted Apache and everything worked as expected

Summary

Basically this issue is related to Doctrine but I was working with Symfony so I preferred to post about both.

 

Hope I helped,

Shak.

Work In Progress 🚧
Discipline