include .php file in folder above

后端 未结 5 1213
既然无缘
既然无缘 2021-02-15 09:49

I am receiving this error

Warning: include(../config.php) [function.include]: failed to open stream: No such file or directory in /home/soizastu/public_html/cms/         


        
5条回答
  •  余生分开走
    2021-02-15 10:22

    Try computing the absolute path and including that.

    include(dirname(__FILE__)."/../config.php");
    

    I think it's the safest bet when dealing with multiple levels of include.

提交回复
热议问题