bbs和first.php在同级目录下first.php<?
require_once("./bbs/include/common.inc.php");
include ("./bbs/index.php");
?>结果报错:
arning: require_once(./include/common.inc.php) [function.require-once]: failed to open stream: No such file or directory in D:\ComsenzEXP\wwwroot\bbs\index.php on line 15

解决方案 »

  1.   

    报错是因为 ./include/common.inc.php 没找到,他在哪里呢?
      

  2.   

    ./bbs/include/common.inc.php就在这个路径下啊
      

  3.   

    问题是你的这个php在哪?就是你的这个first.php./表示first.php所在的目录另外看出错信息,似乎incude path事前已经定义了,检查一下ini的设置
      

  4.   

    ./是当前目录没错吧 ,bbs和first.php都在wwwroot里面查了ini里面有:
    ; UNIX: "/path1:/path2"
    ;include_path = ".:/php/includes"
    ;
    ; Windows: "\path1;\path2"
    ;include_path = ".;c:\php\includes"
      

  5.   

    那么bbs/index.php里面有没有这样的语句(或者类似)——require_once("./include/common.inc.php");
      

  6.   

    有require_once("./include/common.inc.php");这句
      

  7.   


    看出错信息应该是在这里面,index源代码是从它本身的目录引入文件的
    你的first提了一级目录,嵌套加载就出错了
      

  8.   


    看出错信息应该是在这里面,index源代码是从它本身的目录引入文件的
    你的first提了一级目录,嵌套加载就出错了 为什么first会提升目录级别啊,那要怎么解决呢?
      

  9.   

    回11楼,还是说要把first.php放到index.php的同级目录下?我主要是想看看相对路径的../和./的效果,这样的话不就看不到了
      

  10.   


    那也别用这么复杂的系统来测试啊,自己写几个简单的echo,分别放到不同的目录,include一下不就看到效果了么