I’m getting this error on my shared hosting account :sick::
Warning: require(/Entities/Account.php) [function.require]: failed to open stream: No such file or directory in /home/undo/public_html/hidraserca/library/Doctrine/Common/ClassLoader.php on line 148
Fatal error: require() [function.require]: Failed opening required ‘/Entities/Account.php’ (include_path=‘/home/undo/public_html/hidraserca/application/…/views:/home/undo/public_html/hidraserca/library:/home/undo/public_html/zf’) in /home/undo/public_html/hidraserca/library/Doctrine/Common/ClassLoader.php on line 148
It does work on my mac so I don’t know what’s happening. :injured:
I don’t think is a good idea to start changing the code in the classes. I think it could solve the problem but it will fail someplace else and I’ll have to change the code again and again.
The real problem is that you don’t have your doctrine class loader setup correctly. The class loader always works with absolute paths. Your include path is irrelevant in this case. The /Entities/Whatever is the tip off.
Check or post your initialization code. Somewhere you have something like:
use Doctrine\Common\ClassLoader;
$loader = new ClassLoader($nameSpace,$nameSpacePath);
$loader->register();
That points your entity namespace to a specific directory containing your entities. It needs to be adjusted to match your server file layout.
I’m not familiar enough with Zend to offer specifics but start by replacing:
resources.entityManager.connection.entities = “/Library/Webserver/Documents/hidraserca/application/models”
With
“/the/actual/shared/host/path/to/applications/models”
That might be all you need to get it to work. At some point you will need an ini file of some sort just for your shared host. If nothing else, your database passwords will probably be different as well as some paths.
If the above does not work then try changing:
$classLoader = new DoctrineCommonClassLoader(‘Entities’,
realpath(Zend_Registry::get(‘config’)->resources->entityManager->connection->entities), ‘loadClass’);
To:
$classLoader = new DoctrineCommonClassLoader(‘Entities’,“/the/actual/shared/host/path/to/applications/models”),‘loadClass’);
In other words. hard code the path directly in the loader. If that works then at least you have confirmed the problem. Then you can figure out how to get the path from the zend configuration system.
If you still have problems then consider posting on the Zend board. I’m sure they can fix you right up.