setting-up Zend
Installing the Zend framework on an old Power Mac G5 on Tiger, I ran into a common PHP library problem.
After copying the whole Zend package into my php include folder, trying to use the project creation script gave me the following Manifest error:
zf.sh create project quickstart
Fatal error: Uncaught exception ‘Zend_Tool_Framework_Manifest_Exception’ with message ‘A provider provided by the Zend_Tool_Framework_Manifest_ManifestBadProvider does not implement Zend_Tool_Framework_Provider_Interface’ in /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/Tool/Framework/Manifest/Repository.php:100
Stack trace:
#0 /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/Tool/Framework/Loader/Abstract.php(104): Zend_Tool_Framework_Manifest_Repository->addManifest(Object(Zend_Tool_Framework_Manifest_ManifestBadProvider))
#1 /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/Tool/Framework/Client/Abstract.php(118): Zend_Tool_Framework_Loader_Abstract->load()
#2 /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/Tool/Framework/Client/Abstract.php(209): Zend_Tool_Framework_Client_Abstract->initialize()
#3 /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/Tool/Framework/Client/Console.php(96): Zend_Tool_Framework_Client_Abstract->dispatch()
#4 /usr/local/lib/php/ZendFramework-1.9.2/bin/zf.php(214): Zend_Tool_ in /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/Tool/Framework/Manifest/Repository.php on line 100
It turned out that the Zend tool was finding the wrong provider in the unit tests directory. I’m still not sure about what happens, but removing the test folder from the include_path did the trick.
However, I did scratch my head a bit on the following:
Fatal error: Cannot redeclare class Zend_OpenId_Provider in /usr/local/lib/php/ZendFramework-1.9.2/library/Zend/OpenId/Provider.php on line 44
After a bit of searching, I discovered two things:
- Don’t put the Zend framework package directory in any subdirectory of your document root or it will be picked up as well
- Clean your server from any other Zend libraries before trying to use a new one! Seems obvious enough, but when you are appointed a machine with lots of ‘history’ (let’s keep it that way), you can’t always do what you want…
Zend has now been installed, but I am still not really happy about having to separate the whole framework directory (eg, removing the test directory) in order to have things working. Anyone has an update on this?
Edit – Setting up the environment variable ZEND_TOOL_INCLUDE_PATH to the proper library on the server solves this as well. In particular, the first finding above is not valid anymore, but it doesn’t prevent you from doing a bit of house cleaning anyways ;)