How to get the absolute path to the public_html folder?

后端 未结 11 1350
离开以前
离开以前 2020-12-08 14:25
$_SERVER[\'DOCUMENT_ROOT\']

returns

/usr/local/apache/htdocs/

is there a way to get

/home/us         


        
11条回答
  •  失恋的感觉
    2020-12-08 15:10

    Where is the file that you're running? If it is in your public html folder, you can do echo dirname(__FILE__);

提交回复
热议问题