el-sid Posted May 27, 2010 Share Posted May 27, 2010 Hello all, First, let me say that i know this is a known issue...but even after googling around, am still not able to get past this error. Any help would be REALLY appreciated. What im trying to do is use individual components from zend framework - in this case, the loader class to autoload all by classes in the lib directory. my app structure is as follows: Root application lib vendor Zend Loader(directory with all its components inside) Loader.php web index.php bootstrap.php the code in the bootstrap is as follows set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lib'); require_once dirname(__FILE__) . '/lib/vendor/Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); when i execute this, i get: Warning: require_once(Zend/Loader.php): failed to open stream: No such file or directory in /home/sydney/Projects/Merchant/lib/vendor/Zend/Loader/Autoloader.php on line 24 Fatal error: require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/php:/home/sydney/Projects/Merchant/lib') in /home/sydney/Projects/Merchant/lib/vendor/Zend/Loader/Autoloader.php on line 24 I'm using debian lenny. I know this must be a configuration issue but i just cant get my head around it. Any help is appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/203124-zend-autoload-problem/ Share on other sites More sharing options...
jmelnick Posted May 28, 2010 Share Posted May 28, 2010 Hello el-sid, I think the problem may be with this line: set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lib'); the Zend Framework is one more directory below where it usually is in your setup. I would be inclined to add that sub folder to the include path like this: set_include_path( dirname(__FILE__) . '/lib/vendor' . PATH_SEPARATOR . get_include_path()); This this will make things right with the universe. if you need access to the directory above this add it at the end, before the get_include_path() Joseph Melnick JM Web Consultants Toronto, Ontario, Canada Quote Link to comment https://forums.phpfreaks.com/topic/203124-zend-autoload-problem/#findComment-1064483 Share on other sites More sharing options...
el-sid Posted May 28, 2010 Author Share Posted May 28, 2010 Hello el-sid, I think the problem may be with this line: set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lib'); the Zend Framework is one more directory below where it usually is in your setup. I would be inclined to add that sub folder to the include path like this: set_include_path( dirname(__FILE__) . '/lib/vendor' . PATH_SEPARATOR . get_include_path()); This this will make things right with the universe. if you need access to the directory above this add it at the end, before the get_include_path() Joseph Melnick JM Web Consultants Toronto, Ontario, Canada Hi, thanks for the reply. you were right in that i needed to add the vendor directory and your solution worked. My intention was to try and autoload the entire lib directory as some of my classes will be located at the lib root directory. So i gather in order to autoload the entire lib directory i would have to include another path -this time to the lib yes? Quote Link to comment https://forums.phpfreaks.com/topic/203124-zend-autoload-problem/#findComment-1064509 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.