I just want to get $_SERVER['DOCUMENT_ROOT'] from the command line using PHP.
PHP docs say:
You may or may not find any of the following elements in $ _SERVER. Please note that when you start PHP on the command line, some of them will be available (or even make any sense).
Is there a known alternative to achieve the result? Sorry in advance if this is a duplicate, but I cannot find anything on this particular issue.
source share