phpstorm doesn't set $_SERVER['DOCUMENT_ROOT'] in debug

phpstorm doesn't set $_SERVER['DOCUMENT_ROOT'] in debug. Even if set custorm woking directory in debug(run) configuration

5 comments
Comment actions Permalink

These values supposed to be set by web server not by debugger or IDE.

If you run a simple test file (which prints results of phpinfo(); ), you will see that $_SERVER['DOCUMENT_ROOT'] entry has no value when run in CLI mode.

info.php
<?php
    phpinfo();
?>

php -f info.php


If you want such functionality to be implemented in PhpStorm -- you are welcome to leave feature request/bug report here: http://youtrack.jetbrains.net/issues/WI#newissue=yes

0
Comment actions Permalink

Hello Vasiliy,

phpstorm doesn't set $_SERVER['DOCUMENT_ROOT'] in debug. Even if set custorm woking directory in debug(run) configuration

What value supposed to be? This value is not controlled by IDE.

Probably it is a kind of feature request, so please elaborate.

Thank you for feedback!

0
Comment actions Permalink

Andriy,

Thank you for your help!:)

0
Comment actions Permalink

I just set it myself. I use a bootstrap file and have this line in it:

$_SERVER["DOCUMENT_ROOT"]     = str_replace("\\phpunit", "", __DIR__)."\\";

Of course, that is with my phpunit folder as one level deep in my project:

c:\Intranet_Local is the project

c:\Intranet_Local\phpunit is the phpunit directory.

0
Comment actions Permalink

Keith,

Thanks for sharing!

0

Please sign in to leave a comment.