Re: How can I replace $_SERVER["DOCUMENT_ROOT"] in PHP 7.0?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 14/09/2021 08:57, Bo Berglund wrote:
And the result comes out like this:
1. curdir: /data/25/2/158/91/2484743/user/2721122/htdocs/log
2. docroot: /usr/services/vux/apache/htdocs
3. phpdir: /usr/services/vux/apache/htdocs/php

To account for symlinks (which allow you to pretend a file or directory is in another place on the filesystem), run each path through realpath() (I believe __DIR__ is already resolved for its "real path", but it doesn't hurt to run it through again in this case to be sure)

The curdir value smells to me like some sort of admin panel (similar to cpanel setup) that may be using chroot or containers. In this case it may be better to consult a forum or mailing list specific to this admin panel software - they're more likely to know why this discrepency exists and how you should account for it.



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux