failed to open stream: No such file or directory 问题大全,本文由烈火网小编收集整理,请在转载时保留出处。php
案例一:apache
(failed to open stream: No such file or directory)在IIS下PHP环境配置的目录权限致使出错的问题安全
缘由及解决方法:网站
配置环境为 IIS + phpui
若是确认你的程序在其余环境下下能够正常运行而惟独在Win 下的 IIS 出现相似以下的错误:spa
Warning: main(./Config.php): failed to open stream: No such file or directory in D:\wwwroot\Demo\Config.php on line 13code
Fatal error: main(): Failed opening required './Config.php' (include_path='.;c:\php4\pear') in D:\wwwroot\Core\Config.php on line 13blog
这个问题主要是 因为Win NTFS盘下去除了everyone 权限引发的, 在安全权限中加个 Internet 来宾帐号就解决了.ip
操做步骤: D盘 -> 属性 -> 安全 -> 添加 用户 IUSR_XXXXX OKit
案例二:
问题就是:
Warning: require_once(../lib/DBUtil.class.php) [function.require-once]: failed to open stream: No such file or directory in E:\phppro\dxh\service\ExpertService.class.php on line 2
Fatal error: require_once() [function.require]: Failed opening required '../lib/DBUtil.class.php' (include_path='.;C:\php5\pear') in E:\phppro\dxh\service\ExpertService.class.php on line 2
解决方法:
1.在require时加上dirname(__FILE__),像这样: require_once(dirname(__FILE__)."/../lib/DBUtil.class.php");
2.以下理解 require_once实例:
案例三:
运行php网站,出错,内容以下:
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required 'E:/php/www/mrsoft/注册登陆模块/index.php' (include_path='.;C:\php5\pear') in Unknown on line 0
文件结构:
解决方法:
apache不能解析上图中“注册登陆模块”的中文URL,把它换成英文路径便可。