【问题标题】:How to set_include_path in php (Dreamweaver)?如何在 php (Dreamweaver) 中设置_include_path?
【发布时间】:2013-01-21 17:10:34
【问题描述】:

php项目如何设置_include_path?

现在我设置路径是

include('Zend/Search/Lucene.php');<br>
set_include_path('Zend'.PATH_SEPARATOR.get_include_path());<br>
require_once('Zend/Loader.php');

保存这个项目的目录是

C:\AppServ\www\Search

这个文件夹里有Zend(Zend是ZF的库)

现在显示

警告: Zend_Search_Lucene_Storage_Directory_Filesystem::require_once(Zend/Search/Lucene/Storage/File/Filesystem.php) [zend-search-lucene-storage-directory-filesystem.require-once]: 失败打开流:第 349 行的 C:\AppServ\www\Search\Zend\Search\Lucene\Storage\Directory\Filesystem.php 中没有这样的文件或目录

致命错误: Zend_Search_Lucene_Storage_Directory_Filesystem::require_once() [function.require]: 无法打开所需的 'Zend/Search/Lucene/Storage/File/Filesystem.php' (include_path='/Search/ Zend/;.;C:\php5\pear') 在 C:\AppServ\www\Search\Zend\Search\Lucene\Storage\Directory\Filesystem.php 中的第 349 行

请帮帮我。

【问题讨论】:

    标签: php zend-framework lucene dreamweaver set-include-path


    【解决方案1】:

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

    set_include_path("C:\AppServ\www\Search".PATH_SEPARATOR.get_include_path());
    

    另外,在设置包含路径之前不要尝试包含文件(就像您在示例中一样),因为这会失败。

    通常,像这样的类应该位于您的 Web 根目录之外,并且您可能不希望在“C:\AppServ”之类的完整路径中硬编码,因为这可能特定于您的开发环境。

    【讨论】:

      猜你喜欢
      • 2013-09-26
      • 2018-07-30
      • 1970-01-01
      • 1970-01-01
      • 2012-06-01
      • 2016-05-02
      • 1970-01-01
      • 1970-01-01
      • 2014-03-24
      相关资源
      最近更新 更多