V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
gdtv
V2EX  ›  问与答

[PHP] mklink 与 dirname(__FILE__)的问题

  •  
  •   gdtv · 2015-01-31 20:03:06 +08:00 · 1860 次点击
    这是一个创建于 3375 天前的主题,其中的信息可能已经有所发展或是发生改变。
    windows8系统,apache+mysql+php网站,真实文件放在 E:\www
    用mklink建立链接:
    mklink /j D:\www E:\www

    httpd.conf设置网站目录:
    DocumentRoot "D:\www"

    在该网站里用dirname(__FILE__)获取到的路径是 E:\www,
    请问怎样才能让dirname(__FILE__)获取到的是D:\www呢? 是不是我的mklink命令写错了?
    1 条回复    2015-01-31 21:24:16 +08:00
    cnwggu
        1
    cnwggu  
       2015-01-31 21:24:16 +08:00
    __FILE__ The full path and filename of the file with symlinks resolved. If used inside an include, the name of the included file is returned.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5239 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 01:21 · PVG 09:21 · LAX 18:21 · JFK 21:21
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.