You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Marc Fromm <Ma...@wwu.edu> on 2008/09/12 18:42:43 UTC

[users@httpd] blank pages

I am setting up a new server. My pages come up blank.

I checked the httpd error log and found this error:
PHP Notice:  Undefined variable: DOCUMENT_ROOT in /var/www/html/studentjobs/index.php on line 6, referer:

Phpinfo on the old (working) server and the new server both report:
DOCUMENT_ROOT  /var/www/html

Does DOCUMENT_ROOT need to be defined someplace else?

Thanks

Marc


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] blank pages

Posted by Bradley Giesbrecht <br...@pixilla.com>.
php.net is your friend

Just type "http://php.net/" followed by something like a function name  
or env var.

http://php.net/error_reporting

Turn on error_reporting in php.ini and your page will not be blank.

You might be using an old script with php5 or newer that use global  
variables.

I think you want $_SERVER[ "DOCUMENT_ROOT" ].

Insert a line in front of line 6 something like and look for  
DOCUMENT_ROOT which you won't find:

die( "<pre>" . print_r( get_defined_vars(  ) , true ) . "</pre>" ) ;


/brad


On Sep 12, 2008, at 9:42 AM, Marc Fromm wrote:

>
> I am setting up a new server. My pages come up blank.
>
> I checked the httpd error log and found this error:
> PHP Notice:  Undefined variable: DOCUMENT_ROOT in /var/www/html/ 
> studentjobs/index.php on line 6, referer:
>
> Phpinfo on the old (working) server and the new server both report:
> DOCUMENT_ROOT  /var/www/html
>
> Does DOCUMENT_ROOT need to be defined someplace else?
>
> Thanks
>
> Marc
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server  
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] blank pages

Posted by fchan <fc...@molsci.org>.
Hi,
Use this script to find out where php is getting these values. Open a 
new file and call it php.ini and then put the following contents:

<?php
   phpinfo();
  ?>

then put this information in your DOCUMENT_ROOT and then call this 
script from your browser and it will show you all of your information 
php on your system.
My apache  webserver wasn't getting changes I made to /etc/php.ini so 
I need to find out why and found apache was using another php.ini in 
another location. I made changes there and it apache recognizes these 
changes.
I hope this helps,
Frank

>I am setting up a new server. My pages come up blank.
>
>I checked the httpd error log and found this error:
>PHP Notice:  Undefined variable: DOCUMENT_ROOT in 
>/var/www/html/studentjobs/index.php on line 6, referer:
>
>Phpinfo on the old (working) server and the new server both report:
>DOCUMENT_ROOT  /var/www/html
>
>Does DOCUMENT_ROOT need to be defined someplace else?
>
>Thanks
>
>Marc
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] blank pages

Posted by Justin Pasher <ju...@newmediagateway.com>.
Marc Fromm wrote:
> I am setting up a new server. My pages come up blank.
>
> I checked the httpd error log and found this error:
> PHP Notice:  Undefined variable: DOCUMENT_ROOT in /var/www/html/studentjobs/index.php on line 6, referer:
>
> Phpinfo on the old (working) server and the new server both report:
> DOCUMENT_ROOT  /var/www/html
>
> Does DOCUMENT_ROOT need to be defined someplace else?
>
> Thanks
>
> Marc
>   

This particular error is more of a PHP error than apache. What do lines 
1-6 read in your file? I'm guessing you are trying to read from a 
variable called $DOCUMENT_ROOT (which is not set). If you are trying to 
read from the server set value, you should use 
$_SERVER['DOCUMENT_ROOT']. If the file works on the other server, then 
it probably means you have register_globals set to "on", which is a very 
bad idea.

Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org