gdtv
V2EX  ›  问与答

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

  •  
  •   gdtv · Jan 31, 2015 · 2634 views
    This topic created in 4135 days ago, the information mentioned may be changed or developed.
    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 replies    2015-01-31 21:24:16 +08:00
    cnwggu
        1
    cnwggu  
       Jan 31, 2015
    __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.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2908 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 15:13 · PVG 23:13 · LAX 08:13 · JFK 11:13
    ♥ Do have faith in what you're doing.