路径是对的,如果我把require("../count/count.php");放在和count.php同一目录下就对了,我现在放在上一个目录里。还有一个问题,在win2k+apche可以的。同样的文件linux+apche就不行了。这是什么原因?

解决方案 »

  1.   

    count.php 路径不对是这样的提示了。
    Warning: main(../coun/count.php): failed to open stream: No such file or directory in D:\index.php on line 3Fatal error: main(): Failed opening required '../coun/count.php' (include_path='.;c:\php4\pear') in D:\index.php on line 3
      

  2.   

    require("../count/count.php");和require("./count/count.php");有什么区别。
      

  3.   

    使用相对于网站根的路径就没有这些问题了
    包含文件不在include_path中时需要一个绝对路径,可用realpath函数来构造。其实
    include_path表示的不也是绝对路径吗?