|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello group,
I am new to php. I have just bought a good book by Welling and Thomson and was following the example codes. 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. I installed everything on my local computer using xampp and I am using Zend IDE. And I have searched through archives as well as google and not found any useful advice. Thanks! Saurabh. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2008/8/29 Saurabh Agrawal <mailsaurabh@gmail.com>:
> 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); ? -- http://www.otton.org/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
>
> > > 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 ! Saurabh. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Does Zend use a separate instance of Apache or some other webserver ?
Stijn Saurabh Agrawal wrote: >> >>> 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 ! > > Saurabh. > > |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Fri, Aug 29, 2008 at 5:06 PM, metastable <listpit@metastable-services.net
> wrote: > Does Zend use a separate instance of Apache or some other webserver ? > > Stijn > > Actually I don't know the answer to this. How can I find that out? AFAIK, while custom installation, it didn't ask for any such option. Thanks! Saurabh. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On 29 Aug 2008, at 12:47, Saurabh Agrawal wrote:
> On Fri, Aug 29, 2008 at 5:06 PM, metastable <listpit@metastable-services.net >> wrote: > >> Does Zend use a separate instance of Apache or some other webserver ? >> >> Stijn >> >> > Actually I don't know the answer to this. How can I find that out? > > AFAIK, while custom installation, it didn't ask for any such option. Zend Studio does not install Apache at all. By default, when you run a file from within the IDE it does so as a CLI script. This means there will be no DOCUMENT_ROOT defined which is what you're seeing. -Stut -- http://stut.net/ |
|
![]() |
| Outils de la discussion | |
|
|