$_SERVER['DOCUMENT_ROOT'] resolution in IDE
As of PhpStorm 2016.3 $_SERVER['DOCUMENT_ROOT'] always resolves to the project root directory. It would be very helpful if it were possible to specify the document root in a project configuration and for this to be used by the IDE for resolving $_SERVER['DOCUMENT_ROOT']. This could allow the IDE to reflect the behaviour of a typical web server and support correct path resolution in error checking.
e.g.
Web server project root: /home/accountname
Web server document root: /home/accountname/public_html
Include directory: /home/accountname/includes
Include file code: include dirname($_SERVER['DOCUMENT_ROOT']) . '/includes/includefile.php';
Please sign in to leave a comment.
Hi there,
Currently not possible.
https://youtrack.jetbrains.com/issue/WI-35064 -- consider voting for it.
Thanks Andriy,
That's exactly what I was looking for, but I'm new to PhpStorm and missed it. I've voted.