php require_once“FILENAME”导致失败打开所需''

时间:2013-11-29 19:14:16

标签: php zend-framework

在.php我有这个:

Line 64  require_once 'Zend/View/Stream.php'

在apache错误日志中我看到:  [error] [client 127.0.0.1] PHP致命错误:require_once():无法打开所需''(include_path ='.........

我一直在谷歌和调试四个小时..也许这听起来很熟悉某人.. 我不明白代码行如何

require_once 'Zend/View/Stream.php'

原因

Failed opening required ''

1 个答案:

答案 0 :(得分:1)

编辑根据https://bugs.php.net/bug.php?id=62398,在PHP 5.4的某些早期版本的APC扩展中存在一个错误,它用空字符串替换了传递给require的文件。< / p>

感谢@conceptdeluxe,他在使用PHP 5.4.30和APC 3.1.13时想到了这一点。 已确认可能的解决方案是通过配置指令apc.stat=1(在php.ini中)或升级PHP和扩展来启用APC。

否则

您可能希望按照http://php.net/manual/fr/function.set-include-path.php

上提供的说明更新include_path配置选项

基本上,需要告诉解释器在哪里寻找Zend类。

我们假设Zend库可以从/var/www/my_project/vendor/Zend获取,然后我们可以在使用Zend Stream之前拨打下一个电话:

set_include_path(get_include_path() . PATH_SEPARATOR . '/var/www/my_project/vendor');

另一个解决方案是改变PHP配置文件 通过更新include_path值如下:

# assuming vim is available as text editor 
# and PHP configuration file would be available for editing
vim /etc/php.ini

# append /var/www/my_project/vendor to the value of entry
include_path='.:/var/www/my_project/vendor'
相关问题