V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
gdtv
V2EX  ›  问与答

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

  •  
  •   gdtv · Jan 31, 2015 · 2586 views
    This topic created in 4107 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   ·   880 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 144ms · UTC 22:12 · PVG 06:12 · LAX 15:12 · JFK 18:12
    ♥ Do have faith in what you're doing.