Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php(Dreamweaver)中设置_include_路径?_Php_Zend Framework_Lucene_Dreamweaver_Set Include Path - Fatal编程技术网

如何在php(Dreamweaver)中设置_include_路径?

如何在php(Dreamweaver)中设置_include_路径?,php,zend-framework,lucene,dreamweaver,set-include-path,Php,Zend Framework,Lucene,Dreamweaver,Set Include Path,如何为php项目设置包含路径 现在我设定的路径是 include('Zend/Search/Lucene.php');<br> set_include_path('Zend'.PATH_SEPARATOR.get_include_path());<br> require_once('Zend/Loader.php'); include('Zend/Search/Lucene.php') 设置包含路径('Zend'.path_SEPARATOR.get_include_p

如何为php项目设置包含路径

现在我设定的路径是

include('Zend/Search/Lucene.php');<br>
set_include_path('Zend'.PATH_SEPARATOR.get_include_path());<br>
require_once('Zend/Loader.php');
include('Zend/Search/Lucene.php')
设置包含路径('Zend'.path_SEPARATOR.get_include_path())
require_once('Zend/Loader.php');
保存此项目的目录是

C:\AppServ\www\Search

此文件夹中有Zend(Zend是ZF的库)

现在它显示

警告:Zend\u Search\u Lucene\u Storage\u Directory\u Filesystem::require\u once(Zend/Search/Lucene/Storage/File/Filesystem.php)[Zend Search Lucene Storage Directory Filesystem.require once]:无法打开流:在第349行的C:\AppServ\www\Search\Zend\Search\Search\Search\Lucene\Storage\Directory\Filesystem.php中没有这样的文件或目录

致命错误:Zend\u Search\u Lucene\u Storage\u Directory\u Filesystem::require\u once()[function.require]:无法打开C:\AppServ\www\Search\Zend\Search\Lucene\Storage\Directory\Filesystem.php行中所需的“Zend/Search/Lucene/Storage/File/Filesystem.php”(include\path='/Search/Zend/;C:\php5\pear')


请帮助我。

您的包含路径应设置为包含Zend文件夹的文件夹,而不应设置为Zend文件夹本身。因此,假设Lucene.php文件的正确位置是
C:\AppServ\www\Search\Zend\Search\Lucene.php
,您需要:

set_include_path("C:\AppServ\www\Search".PATH_SEPARATOR.get_include_path());
另外,在设置include路径之前不要尝试包含该文件(正如您在示例中所做的那样),因为这样会失败

一般来说,这样的类应该位于web根目录之外,并且您可能不想在完整路径(如“C:\AppServ”)中硬编码,因为这是特定于您的开发环境的