Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/259.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 NetBeans的包含路径不工作_Php_Zend Framework_Netbeans - Fatal编程技术网

Php NetBeans的包含路径不工作

Php NetBeans的包含路径不工作,php,zend-framework,netbeans,Php,Zend Framework,Netbeans,我有一个NetBeansProject,它在ZendFramework库上工作,并使用PHPUnit进行测试,但每次调用Zend Framework的某个函数时,引导文件都会调用它们,例如,它会给出一个致命错误,因为它找不到这些文件: 致命错误:require_once:无法打开所需的“Zend/Db/Table/Abstract.php”include_path=”。;C:\xampp\htdocs\pear;C:\xampp\php\PEAR'in 我的引导文件如下所示: <?php

我有一个NetBeansProject,它在ZendFramework库上工作,并使用PHPUnit进行测试,但每次调用Zend Framework的某个函数时,引导文件都会调用它们,例如,它会给出一个致命错误,因为它找不到这些文件: 致命错误:require_once:无法打开所需的“Zend/Db/Table/Abstract.php”include_path=”。;C:\xampp\htdocs\pear;C:\xampp\php\PEAR'in

我的引导文件如下所示:

<?php

ini_set('display_startup_errors', 1);
ini_set('display_errors', 2);

defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing'));

defined('LIBRARY_PATH')
    || define('LIBRARY_PATH', realpath(dirname(__FILE__) . '/../library'));

defined('TESTS_PATH')
    || define('TESTS_PATH', realpath(dirname(__FILE__)));


//Define constant global variable
defined('_FOO_ROOT_DIR_') || define('_FOO_ROOT_DIR_', dirname(dirname(__FILE__)));
defined('_FOO_APP_DIR_') || define('_FOO_APP_DIR_', _FOO_ROOT_DIR_ . '/application');
defined('_FOO_LIB_DIR_') || define('_FOO_LIB_DIR_', _FOO_ROOT_DIR_ . '/library');
defined('_FOO_PUBLIC_DIR_') || define('_FOO_PUBLIC_DIR_', _FOO_ROOT_DIR_ . '/public');
defined('_FOO_TEST_DIR_') || define('_FOO_TEST_DIR_', _FOO_ROOT_DIR_ . '/tests');
defined('_FOO_ZF_DIR_') || define('_FOO_ZF_DIR_', 'C:\zend\ZendFramework-1.11.11\library');

require_once 'Zend/Db/Table/Abstract.php';
.
.
.
.
#End of bootstrap.php
而触发错误的正是这一次。例如,如果我修改引导文件,而不是从'Zend/Db/Table/Abstract.php'执行require,而是从'u FOO_ZF_DIR.'/Zend/Db/Table/Abstract.php'执行require,那么问题就解决了,但我必须重写Zend库每个文件中的每个include

include上框架的路径是正确的,我已经用上面部分复制的引导文件配置了PHPUnit,以及我的合作伙伴已经为我提供的PHPUnit.xml,该项目已经设置并运行

phpunit.xml看起来像这样,我不知道它是否与主题相关:

<phpunit bootstrap="./bootstrap.php" colors="true">
    <testsuite name="ApplicationTestSuite">
        <directory>./application/</directory>
        <directory>./library/</directory>
    </testsuite>
    <filter>
        <whitelist>
            <directory suffix=".php">../application</directory>
            <exclude>
                <directory suffix=".php">../application/modules/pal</directory>
                <directory suffix=".phtml">../application/views</directory>
                <file>../application/Bootstrap.php</file>
            </exclude>
        </whitelist>
    </filter>
    <logging>
        <log type="coverage-html" target="./log/coveragereport" charset="UTF-8"
             yui="true" highlight="false" lowUpperBound="35" highLowerBound="70"/>
    </logging>
</phpunit>
我还配置了选项工具上的Zend选项卡,注册了提供者等等。 那么,我该如何解决这个问题,以便NetBeans能够检测到不仅要找到与项目文件夹相关的include,还要找到与包含的库路径相关的include

我还尝试通过全局php包含包含库,通过项目属性包含特定于项目的库,但两者都不起作用

提前谢谢

解决了! 我忘了在php.ini文件中包含ZendFramework库的路径

这就是我所拥有的: 包括路径=。;C:\xampp\htdocs\pear;C:\xampp\php\PEAR

这就是它工作所需要的: 包括路径=。;C:\xampp\htdocs\pear;C:\xampp\php\PEAR;C:\zend\ZendFramework-1.11.11\library

问候