龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

PHP相对路径问题

时间:2014-07-22 14:52来源: 作者: 点击:
分享到:
span style=color:#333333;font-family:Georgia, Times New Roman, Times, san-serif;span style=font-size:14px;line-height:25px;span style=font-family:verdana, 宋体, Arial;line-height:24px;font-size:13px;p style=margin-top:5px;margin-right:auto

IIS下 PHP FastCgi的问题

require路径缓存的问题 

require系列函数包含相对路径相同 


/*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。
精彩图集

赞助商链接