How are paths calculated in PHP - Why are files in the current directory ignored?

前端 未结 3 1186
眼角桃花
眼角桃花 2021-01-22 21:31

Update:

The index.php file here:

/public_html/d/index.php

includes:

/public_html/d/core/source/class.File1.php
<         


        
3条回答
  •  醉酒成梦
    2021-01-22 21:54

    • getcwd() always returns the same path no matter what file it is located in ( on my system ). A Bug in my opinion.

    • ( On my system ) PHP found another file in a path not specified in the include list or in the current directory. This is a bug in my opinion.

    • On my system, if you don't want to use absolute paths...the only way I've found to use relative paths is dirname(__FILE__); to prepend where you want to go.

    • . or ./ prepending the file did not work either....

提交回复
热议问题