Case-inconsistency of PHP file paths on Mac / MAMP?

前端 未结 4 684
日久生厌
日久生厌 2020-12-29 23:22

I\'m developing a PHP program on MAMP, and just realized the following screwy behavior:

echo \"
PATH = \".dirname(__FILE__); include \'include.php\
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-30 00:04

    What about creating an include file in the same directory as your app.

    
    

    Use it like so:

    $trueDIR = include('get_true_dir.php');
    

    From what you posted above, this should work. Yes, it's a bit of a hacky workaround, but it is a workaround, and should work even on systems not suffering from this issue.

提交回复
热议问题