0

我在 cloudcontrol.com 上设置了 Zend 项目,设置完所有内容后,运行它会出现以下错误:

Warning: require_once(/srv/www/code/library): failed to open stream: No such file or directory in /srv/www/code/library/Zend/View.php on line 64

Fatal error: require_once(): Failed opening required '' (include_path='/srv/www/code/library:.:/usr/share/php') in /srv/www/code/library/Zend/View.php on line 64

Zend/View.php on line 61里面Zend_View::__constructor()如下:

require_once 'Zend/View/Stream.php';

从错误中可以看出,包含路径很好。如果我从这里删除这一行并将其放在Zend_View类定义之前(比如第 27 行),它可以正常工作。

任何帮助将非常感激。

PS我不是ZF1开发的菜鸟。此外,这个完全相同的代码在两台服务器上运行良好。此问题仅发生在 cloudcontrol 上。

4

1 回答 1

0

您需要为库设置包含路径,就像我在 index.php 文件中设置的那样

set_include_path(implode(PATH_SEPARATOR, array(
    dirname(dirname(__FILE__)) . '/library',
    dirname(__FILE__) . '/library',
    get_include_path(),
)));

希望这会有所帮助!

于 2013-11-06T08:12:19.393 回答