I recently spent several hours beating my head against the wall trying to figure out why Doctrine and Zend weren’t playing nice together. I was using the version of Apache and PHP that comes with Mac OS X Leopard. When trying to load up the site in my Zend framework I got the error:
Warning: Zend_Loader::include_once(Doctrine/Adapter/Mysql.php): failed to open stream: No such file or directory
Which made me think I was missing the mysql adapter for Doctrine. Looking in the Doctrine/Adapter folder, at least with the latest version, you’ll notice there is only a Mysqli.php no Mysql.php. This led me to think that I was missing some essential library for Doctrine. However, this was not the case. The issue is that the build of PHP that comes with Mac OS X Leopard does not include pdo_mysql. The extension is listed in the php.ini file and you can uncomment it, but it won’t load. Rather than try and compile PHP with pdo_mysql support I decided to move to MAMP. Which turned out to be a wonderful choice. It’s got pdo_mysql support in its PHP build. It’s also a great way to do local development since you can easily turn it on, or restart. I would highly recommend it for development on your local machine.
hi,
i’v got the same problem. I also switched to MAMP, but although I stopped my other apache, I get the same problem.
It looks like doctrine is still caling my php.ini wich is located in /usr/local/lib instead of the one located in the config dir of Mamp.
any ideas or stuff I forgt to do?
thx
@joren I think once I switched to MAMP it just worked. If you’re accessing the site on the MAMP port, 8888 default, then you’re definitely accessing it’s copy of Apache.
I’d suggest testing which php.ini it’s loading by throwing some garbage in it and checking that generates an error. If that doesn’t work take a look at the PHP error logs, maybe something’s going wrong when PHP starts. Hope you can figure it out.
Thanks for the info, am having same problem, but I added pdo_mysql with these instructions, although i m still getting : Warning: Zend_Loader::include_once(): Failed opening ‘Doctrine/Adapter/Mysql.php’ for inclusion …..
http://www.entropy.ch/phpbb2/viewtopic.php?t=2945
I like having it all properly configed, don t know why I resist mamp so much.
finally fixed it, the php called by apache was updated, problem lies in the php used by php-cli which still used the old one, just use #!/usr/local/php5/bin/php instead and that’s it
@Charles Yeah, unfortunately if you’re re-compiling PHP you have to do the command line utility as well. This does have the advantage of making it easier to use PHP from terminal.
Thanks bro, helped me solve an issue that’s been kicking me for awhile.
Thank you for your post. It helped me to find my mistake..
Omg, you have no idea of how useful this article was to me!
I spent precious minutos trying to find out the problem
Thanks!
Thanks, very helpful to have this context for that error message!