我使用Zend Framework的库和代码php(不使用struct Zend,只使用Zend Framework库),当我加载Zend的库时出错:
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Search/Lucene/Storage/File/Filesystem.php'
(include_path='.;C:'php'pear;C:'wamp'www'Zend') in C:'wamp'www'...'Zend'Search'Lucene'Storage'Directory'Filesystem.php on line 349
我把Zend的库放在C:''wamp''www''Zend中我在php代码中调用Zend库:
ini_set("include_path", ini_get("include_path") . ";C:''wamp''www''Zend");
require_once 'Zend/Search/Lucene.php';
在这种情况下,如何加载zend的库?
尝试更改:
ini_set("include_path", ini_get("include_path") . ";C:''wamp''www''Zend");
至
ini_set("include_path", ini_get("include_path") . PATH_SEPARATOR . 'C:''wamp''www');
由于所有Zend Framework文件都包含在文件名前面的Zend
目录中(即require_once 'Zend/Search/Lucene.php';
),因此包含路径应包含Zend
目录所在的路径,但不应将Zend
文件夹本身添加到include_path
考虑具有以下包含路径的require_once 'Zend/Loader.php';
:
C:''wamp''www''Zend
;解析为require_once 'C:''wamp''www''Zend''Zend'Loader.php';
(错误)
C:''wamp''www
,解析为require_once 'C:''wamp''www''Zend'Loader.php';
(正确)