Re: [PHP] _SERVER['DOCUMENT_ROOT'] not set?





In one of the examples, I am supposed to access _SERVER['DOCUMENT_ROOT'].
However, when I am seeing its value in the debug stack, I am getting it
to
be null! Even phpinfo() is showing that this particular variable does not
even exist, though there are other _SERVER[''] declarations.

What's DocumentRoot set to in your Apache config? (httpd.conf) Check
any VirtualHost blocks you might have, too.

What's the result of print_r($_SERVER); ?



In httpd.conf,

DocumentRoot "D:/xampp/htdocs"

No VirtualHost blocks.

David, I just found a thing. I had been running this script within the Zend
IDE, looking at output in the IDE itself. Now that I see the output in
Firefox, I can see the variable in phpinfo(), as well as in the output of
print_r($_SERVER).

It must be something to do with Zend, then. Is that it?

Even the output of print_r contains the line
[DOCUMENT_ROOT]=>D:/xampp/htdocs in Firefox, but no such line in Zend!

Thanks for the help!

Saurabh.


Relevant Pages

  • Re: What IDE are you using?
    ... brick wall, an old brick wall. ... Your statement is that any programmer who doesn't use an IDE such as ZEND isn't as productive as one who does. ... Let's see - you try to fit everyone into one mold. ...
    (comp.lang.php)
  • Re: Re: PHP IDE.
    ... > Zend studio is with out a doubt the best IDE for php ... > but he asked for a FREE one, last time i checked zend wasn’t as ...
    (comp.lang.php)
  • Re: PHP debugging
    ... >* debugger. ... I recently tried Zend and have since gone back to UEdit on windoze ... Zend has a couple of useful features.. ... Zend IDE has the slowest, cludgiest editor I've ever used; ...
    (comp.lang.php)
  • Re: [PHP] error messages
    ... tedd wrote: ... All my development is spent online -- the browser god is not forgiving. ... One of these days I'll get the Zend IDE to work. ...
    (php.general)
  • silly question about zend
    ... I wanted some sort of IDE for PHP, so decided to use Zend (which i believe ... how to open Zend so that can ...
    (php.general)