dongzongzhi6953 2013-11-29 19:14
浏览 22

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

In .php I have this:

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

in apache error log I see: [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '' (include_path='.........

I've been googleing and debugging four hours.. Maybe this sounds familiar to someone.. I dont understand how code line

require_once 'Zend/View/Stream.php'

cause

Failed opening required ''
  • 写回答

1条回答 默认 最新

  • doubipeng1336 2014-07-29 19:17
    关注

    EDIT According to https://bugs.php.net/bug.php?id=62398, there was a bug in some earlier versions of APC extension with PHP 5.4 which replaced the file passed to require with an empty string.

    Thanks to @conceptdeluxe, who figured this out when using PHP 5.4.30 with APC 3.1.13. A possible resolution has be confirmed to be about enabling APC via configuration directive apc.stat=1 (in php.ini) or upgrading PHP and extensions.

    Otherwise

    You might want to update the include_path configuration option by following instructions available at http://php.net/manual/fr/function.set-include-path.php

    Basically, the interpreter needs to be told where to look for the Zend classes.

    Let us assume, Zend library is available from /var/www/my_project/vendor/Zend then we could make the next call before using Zend Stream:

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

    Another solution would consist in altering the PHP configuration file by updating the include_path value as follow:

    # 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'
    
    评论

报告相同问题?

悬赏问题

  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线