Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$_SERVER['document_root']?

is this pointing to the directory where the current file is executed?

like image 331
ajsie Avatar asked Jul 06 '26 13:07

ajsie


1 Answers

No, it points to the root of your webserver - the topmost folder of your website.

If you want the directory of the current file, use:

dirname(__FILE__);

like image 127
Adam Hopkinson Avatar answered Jul 08 '26 03:07

Adam Hopkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!