PHP相对路径问题

字体大小: 中小 标准 ->行高大小: 标准

/*IIS下 PHP FastCgi的问题
require路径缓存的问题
require系列函数包含相对路径相同
比如:*/

  /root/web/config/config.php
  /root/web/admin/config/config.php
  config.php的代码不相同
  /*如下: 依次执行下述代码*/
    /root/web目录下php程序代码 : require('config/config.php');  ///root/web/config/config.php
    /root/web/admin目录下php程序代码 : require('config/config.php');  ///root/web/admin/config/config.php
    /root/web目录下php程序代码 : require('config/config.php');  ///root/web/admin/config/config.php
    第二个config.php会将第一个config.php的缓存覆盖掉,第三个执行时使用的是/root/web/admin/config/config.php。

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/29970.html