使用不当出错案例:
在WIN 2003+IIS 6+PHP 5.2.8 环境下getcwd()出错的解决方案。。。(回复:1 查看:40)
具体报错可能为:
Warning: include(c:/windows/system32/inetsrv/conf/conf.php) [function.include]: failed to open stream: No such file or directory in D:\www\xiuno\index.php on line 18
Warning: include() [function.include]: Failed opening 'c:/windows/system32/inetsrv/conf/conf.php' for inclusion (include_path='.;C:\php5\pear') in D:\www\xiuno\index.php on line 18
原因分析:
可能在这样的环境中 ,getcwd() 取值错误,网站程序未能正确执行。
解决办法为:
打开index.php文件,找到
define('BBS_PATH', str_replace('\\', '/', getcwd()).'/');
将其替换为:
define('BBS_PATH', str_replace('\\', '/', substr(__FILE__, 0, -9)));
这篇文章还没有评论