Zend Framework setup issue

2019-08-29 06:17发布

问题:

Trying to setup Zend Framework as instructed in this manual

$paths = array(
    realpath(dirname(__FILE__) . '/libs/Zend'),
    '.',
);
set_include_path(implode(PATH_SEPARATOR, $paths));
require_once 'Zend/Loader.php';

Gives fatal error. (My local webserver is IIS. Remote one is linux)

Local:

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='D:\Web Server\tural.us\core\serverside\libs\Zend;.') in D:\Web Server\tural.us\core\content\pages\utube.php on line 2

Remote:

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='/home/tural/public_html/core/serverside/libs/Zend:.') in /home/tural/public_html/core/content/pages/utube.php on line 2

But in fact, I see that the path in error message is totally right : D:\Web Server\tural.us\core\serverside\libs\Zend;

回答1:

Remove Zend from the path...

realpath(dirname(__FILE__) . '/libs/')

Zend looks for Zend/etc whenever it loads stuff.



回答2:

I think your inclusion of /Zend in the include path is causing the problem. Try:

$paths = array(
    realpath(dirname(__FILE__) . '/libs'),
    '.',
);