$_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';

3
2 comments

Hi there,

Currently not possible.

https://youtrack.jetbrains.com/issue/WI-35064 -- consider voting for it.

0
Avatar
Permanently deleted user

Thanks Andriy,

That's exactly what I was looking for, but I'm new to PhpStorm and missed it. I've voted.

0

Please sign in to leave a comment.