今天用一个客户的vps,配置iis的php虚拟主机,遇到一个错误:PHP Warning: main(config.inc.php) [function.main]: failed to open stream: No such file or directory in D:\wwwroot\qzyjl\includes\common.inc.php on line 25 PHP Warning: main() [function.include]: Failed opening 'config.inc.php' for inclusion (include_path='.;..') in D:\wwwroot\qzyjl\includes\common.inc.php on line 25 PHP Warning: main(version.php) [function.main]: failed to open stream: No such file or directory in D:\wwwroot\qzyjl\includes\common.inc.php on line 26 PHP Warning: main() [function.include]: Failed opening 'version.php' for inclusion (include_path='.;..') in D:\wwwroot\qzyjl\includes\common.inc.php on line 26 PHP Warning: main(base/language/.php) [function.main]: failed to open stream: No such file or directory in D:\wwwroot\qzyjl\includes\common.inc.php on line 27 PHP Warning: main() [function.include]: Failed opening 'base/language/.php' for inclusion (include_path='.;..') in D:\wwwroot\qzyjl\includes\common.inc.php on line 27 PHP Warning: main(includes/db.inc.php) [function.main]: failed to open stream: No such file or directory in D:\wwwroot\qzyjl\includes\common.inc.php on line 28 PHP Warning: main() [function.include]: Failed opening 'includes/db.inc.php' for inclusion (include_path='.;..') in D:\wwwroot\qzyjl\includes\common.inc.php on line 28 PHP Fatal error: Call to a member function query() on a non-object in D:\wwwroot\qzyjl\includes\common.inc.php on line 42
这个错误是由于网站对应的目录,访问者没有权限。
正确的配置方法:像asp那样配好虚拟主机,包括网站标签卡-配置ip地址对应的域名,主目录配置对应的目录,应用程序名,执行权限:纯脚本,应用程序池选择,配置——缓存isapi扩展、扩展名php,对应可执行文件——C:\WINDOWS\system32\inetsrv\fcgiext.dll,动作(如果设置限制:GET,HEAD,POST,TRACE)。文档,首页选index.php。目录安全性,编辑,允许匿名访问,并为匿名访问指定一个内部用户。这个用户是该虚拟主机的用户,也是对网站目录有所有权限的用户。然后再去mysql创建数据库。
简便的配置方法:使用西部数码网站管理助手,连ftp也一起设置了。
星期二, 02/14/2012 - 23:32 — 杨超