[PHP] DOCUMENT_ROOT errors

2009-02-09 Thread Marc Fromm
I updated fedora core from FC5 to TC6, thus httpd and php were updated in the 
process. My pages worked with no errors before the upgrade.
My php pages are no not displaying and generating this error in the httpd logs

PHP Notice:  Undefined variable: DOCUMENT_ROOT in 
/var/www/html/studentjobs/index.php on line 6, referer: 
http://finaid46.finaid.wwu.edu/
PHP Warning:  require(/studentjobs/includes/javascript.php) [a 
href='function.require'function.require/a]: failed to open stream: No such 
file or directory in /var/www/html/studentjobs/index.php on line 6, referer: 
http://finaid46.finaid.wwu.edu/
PHP Fatal error:  require() [a href='function.require'function.require/a]: 
Failed opening required '/studentjobs/includes/javascript.php' 
(include_path='.:/usr/share/pear') in /var/www/html/studentjobs/index.php on 
line 6, referer: http://finaid46.finaid.wwu.edu/

PHP Notice:  Undefined index:  cmd in 
/var/www/html/lan/ztezt/student_alerts/index.php on line 5

My current versions are:
httpd-2.2.6-1.fc6
php-5.1.6-3.7.fc6
php-pear-1.4.9-4 (one error above mentions pear)

Marc



[PHP] $DOCUMENT_ROOT

2002-12-06 Thread christopher calicott

 ?
 echo $_SERVER[DOCUMENT_ROOT];
 ?


c:/wwwroot

is what I get.  I am convinced the problem I am having is due to some issues
with configuration.  Here is why:


I found the script that is the 'original' one that I had working just as an
image displayer - not as part of a larger html document and it works at the
root of the web server.   I've attached that code.  Here's the thing - the
script is identical, with two exceptions.. a) it is executing from the
server root and b) the is just a regular path without the $DOCUMENT_ROOT in
there.  It looks (and it works) like this:

$strRealPath = images/random_gen/;
//$DOCUMENT_ROOT.dirname($SCRIPT_NAME)./;


I cloned this script and renamed it, then changed images/random_gen/ to:
$DOCUMENT_ROOT/images/random_gen/

and guess what?   I guess the EXACT same errors.  It has to be something to
do with where apache or php thinks the root of the server is located...
since the script that is integrated into the site is down a level in the
/includes/ subfolder and it points to images in the
DOCUMENT_ROOT/images/random_gen/ subfolder, I really needed the script to
just say 'okay go to the root of the server then go to this subfolder and
look there.'  It ain't working.

SOo basically I have some sort of configuration issue here. I've
tried modifying httpd.conf - it supposedly wants the documentRoot to be set
to c:/wwwroot instead of the normal c:\wwwroot... I've tried it both ways.
the doc_root= setting in php.ini is set to c:\wwwroot and I've tried it both
ways.

Please help.  I will dance at your wedding. Anybody Buehler?  Buehler?

-=- christopher

-=- christopher


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] document_root

2002-10-01 Thread Tony Crockford

Hi

what exactly does document_root do?

Does it give to path to the file from the server root?

or does it give the path to the server root?

has something changed in 4.2.2

If I want the path to the document I'm in how do I get it?

looked everywhere (manual, books and archive), but the answer is
probably so simple I'm not looking in the right place.

help and abuse gratefully received.

Thanks

Tony


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] document_root

2002-10-01 Thread Brad Bonkoski

document_root is the root path to the webserver.

Check out:
http://www.php.net/manual/en/function.getcwd.php

HTH
-Brad

Tony Crockford wrote:

 Hi

 what exactly does document_root do?

 Does it give to path to the file from the server root?

 or does it give the path to the server root?

 has something changed in 4.2.2

 If I want the path to the document I'm in how do I get it?

 looked everywhere (manual, books and archive), but the answer is
 probably so simple I'm not looking in the right place.

 help and abuse gratefully received.

 Thanks

 Tony

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] document_root

2002-10-01 Thread Chris Shiflett

*cringe*

No, document root is a defined directory, not an attribute of a specific 
file. It is used to map the root URL to a directory on the filesystem.

For example, when you request http://www.google.com/, that final slash 
in the URL is the resource you are requesting. In this case, it is the 
root URL for that domain, and everything branches off from that 
hierarchically.

Document root is the filesystem directory that is equivalent to the root 
URL and is used by the Web server to locate the requested resource. 
Thus, everything within this directory is (potentially, depending on 
permissions) accessible via a URL. For example, if the document root for 
Google were /usr/local/apache/htdocs/, then the URL 
http://www.google.com/foo/bar/blah.php would be equivalent to 
/usr/local/apache/htdocs/foo/bar/blah.php on the filesystem.

Hope that clarifies.

Chris

John W. Holmes wrote:

You want DOCUMENT_ROOT. If you have a file

/home/groups/myproject/htdocs/file.php

then, from within that file.php, DOCUMENT_ROOT is

/home/groups/myproject/htdocs/

I think it would be $_SERVER['DOCUMENT_ROOT'] in newer versions of PHP.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] document_root

2002-10-01 Thread John W. Holmes

You want DOCUMENT_ROOT. If you have a file

/home/groups/myproject/htdocs/file.php

then, from within that file.php, DOCUMENT_ROOT is

/home/groups/myproject/htdocs/

I think it would be $_SERVER['DOCUMENT_ROOT'] in newer versions of PHP.

---John Holmes...

 -Original Message-
 From: Tony Crockford [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 01, 2002 6:01 PM
 To: Php-General@Lists. Php. Net
 Subject: [PHP] document_root
 
 Hi
 
 what exactly does document_root do?
 
 Does it give to path to the file from the server root?
 
 or does it give the path to the server root?
 
 has something changed in 4.2.2
 
 If I want the path to the document I'm in how do I get it?
 
 looked everywhere (manual, books and archive), but the answer is
 probably so simple I'm not looking in the right place.
 
 help and abuse gratefully received.
 
 Thanks
 
 Tony
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] document_root

2002-10-01 Thread Tony Crockford


 Check out:
 http://www.php.net/manual/en/function.getcwd.php

 HTH
 -Brad

Certainly does, thanks.

I suppose if I'd thought to look at the manual contents rather than
trying to construct a *search* I might have found that

Oh well, so much to learn so little time.

Thanks

Tony


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] document_root

2002-10-01 Thread John W. Holmes

OK. My bad. That's why I see DOCUMENT_ROOT on sourceforge is /var/www/,
while my scripts are in /home/groups/p/pr/project/htdocs/.

Sorry for causing confusion in the ranks. :)

So what the OP wants is dirname() ??

---John Holmes...

 -Original Message-
 From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 01, 2002 6:39 PM
 To: [EMAIL PROTECTED]
 Cc: 'Tony Crockford'; 'Php-General@Lists. Php. Net'
 Subject: Re: [PHP] document_root
 
 *cringe*
 
 No, document root is a defined directory, not an attribute of a
specific
 file. It is used to map the root URL to a directory on the filesystem.
 
 For example, when you request http://www.google.com/, that final slash
 in the URL is the resource you are requesting. In this case, it is the
 root URL for that domain, and everything branches off from that
 hierarchically.
 
 Document root is the filesystem directory that is equivalent to the
root
 URL and is used by the Web server to locate the requested resource.
 Thus, everything within this directory is (potentially, depending on
 permissions) accessible via a URL. For example, if the document root
for
 Google were /usr/local/apache/htdocs/, then the URL
 http://www.google.com/foo/bar/blah.php would be equivalent to
 /usr/local/apache/htdocs/foo/bar/blah.php on the filesystem.
 
 Hope that clarifies.
 
 Chris
 
 John W. Holmes wrote:
 
 You want DOCUMENT_ROOT. If you have a file
 
 /home/groups/myproject/htdocs/file.php
 
 then, from within that file.php, DOCUMENT_ROOT is
 
 /home/groups/myproject/htdocs/
 
 I think it would be $_SERVER['DOCUMENT_ROOT'] in newer versions of
PHP.
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] document_root

2002-10-01 Thread Brad Bonkoski

I think:
string getcwd ( void)
would do the trick. (dirname() requires that you know the path of a file and
want to extract just the directory path)
-Brad

John W. Holmes wrote:

 OK. My bad. That's why I see DOCUMENT_ROOT on sourceforge is /var/www/,
 while my scripts are in /home/groups/p/pr/project/htdocs/.

 Sorry for causing confusion in the ranks. :)

 So what the OP wants is dirname() ??

 ---John Holmes...

  -Original Message-
  From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, October 01, 2002 6:39 PM
  To: [EMAIL PROTECTED]
  Cc: 'Tony Crockford'; 'Php-General@Lists. Php. Net'
  Subject: Re: [PHP] document_root
 
  *cringe*
 
  No, document root is a defined directory, not an attribute of a
 specific
  file. It is used to map the root URL to a directory on the filesystem.
 
  For example, when you request http://www.google.com/, that final slash
  in the URL is the resource you are requesting. In this case, it is the
  root URL for that domain, and everything branches off from that
  hierarchically.
 
  Document root is the filesystem directory that is equivalent to the
 root
  URL and is used by the Web server to locate the requested resource.
  Thus, everything within this directory is (potentially, depending on
  permissions) accessible via a URL. For example, if the document root
 for
  Google were /usr/local/apache/htdocs/, then the URL
  http://www.google.com/foo/bar/blah.php would be equivalent to
  /usr/local/apache/htdocs/foo/bar/blah.php on the filesystem.
 
  Hope that clarifies.
 
  Chris
 
  John W. Holmes wrote:
 
  You want DOCUMENT_ROOT. If you have a file
  
  /home/groups/myproject/htdocs/file.php
  
  then, from within that file.php, DOCUMENT_ROOT is
  
  /home/groups/myproject/htdocs/
  
  I think it would be $_SERVER['DOCUMENT_ROOT'] in newer versions of
 PHP.
  

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-03 Thread Jesper Brunholm

David E. Weekly wrote:
IMHO you're better off
 
 I agree and understand why, but...
 
but yes, if you set register_globals = on then 
you shouldn't need to have retooled your scripts.
 
 I agree. =)
 
Did you restart your 
webserver after you adjusted php.ini?
 
 Yes. Full stop/start cycle.

And you're sure to be out of any caching?

regards

Jesper Brunholm

-- 
Phønix - Danish folk music from young musicians - http://www.phonixfolk.dk



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread David E. Weekly

All,

I upgraded from PHP 4.1.2 to 4.2.1 today along with revving Apache to 1.3.26
from 1.3.22, and, woe is me, my $DOCUMENT_ROOT now evaluates to  on all of
my PHP pages!

phpinfo() shows DOCUMENT_ROOT being set correctly under the Apache
variables category. I tried several variations, including setting global
$DOCUMENT_ROOT: and $ENV{DOCUMENT_ROOT} and $GLOBALS[DOCUMENT_ROOT]
and so forth, but all to no avail. Good 'ol $DOCUMENT_ROOT seems quite gone,
and I wasn't able to find mentions of this happening to others on the 'Net.
Any pointers?

-david



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread Kevin Waterson

On Mon, 1 Jul 2002 22:01:27 -0700
David E. Weekly [EMAIL PROTECTED] wrote:

 All,
 
 I upgraded from PHP 4.1.2 to 4.2.1 today along with revving Apache to 1.3.26
 from 1.3.22, and, woe is me, my $DOCUMENT_ROOT now evaluates to  on all of
 my PHP pages!

$_SERVER['DOCUMENT_ROOT']

Kevin
-- 
Kevin Waterson
Byron Bay, Australia

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread David E. Weekly

Kevin,

After many tries, that is what indeed worked, but I'm a little irked, since
shouldn't it have been that setting register_global to On in my php.ini
would re-enable these base globals? I had to retool all of my scripts. =/

-david

- Original Message -
From: Kevin Waterson [EMAIL PROTECTED]
To: David E. Weekly [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, July 02, 2002 7:23 AM
Subject: Re: [PHP] DOCUMENT_ROOT disappeared on me!


 On Mon, 1 Jul 2002 22:01:27 -0700
 David E. Weekly [EMAIL PROTECTED] wrote:

  All,
 
  I upgraded from PHP 4.1.2 to 4.2.1 today along with revving Apache to
1.3.26
  from 1.3.22, and, woe is me, my $DOCUMENT_ROOT now evaluates to  on
all of
  my PHP pages!

 $_SERVER['DOCUMENT_ROOT']

 Kevin
 --
 Kevin Waterson
 Byron Bay, Australia



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread Erik Price


On Tuesday, July 2, 2002, at 10:47  AM, David E. Weekly wrote:

 After many tries, that is what indeed worked, but I'm a little irked, 
 since
 shouldn't it have been that setting register_global to On in my 
 php.ini
 would re-enable these base globals? I had to retool all of my 
 scripts. =/

IMHO you're better off, but yes, if you set register_globals = on then 
you shouldn't need to have retooled your scripts.  Did you restart your 
webserver after you adjusted php.ini?



Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread David E. Weekly

 IMHO you're better off

I agree and understand why, but...

 but yes, if you set register_globals = on then 
 you shouldn't need to have retooled your scripts.

I agree. =)

 Did you restart your 
 webserver after you adjusted php.ini?

Yes. Full stop/start cycle.

-david


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread Jason Wong

On Tuesday 02 July 2002 22:58, David E. Weekly wrote:
  IMHO you're better off

 I agree and understand why, but...

  but yes, if you set register_globals = on then
  you shouldn't need to have retooled your scripts.

 I agree. =)

  Did you restart your
  webserver after you adjusted php.ini?

 Yes. Full stop/start cycle.

And you verified that register_globals is on using phpinfo() ?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
I'm encased in the lining of a pure pork sausage!!
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] DOCUMENT_ROOT disappeared on me!

2002-07-02 Thread Steve Yates

David E. Weekly [EMAIL PROTECTED] wrote in message
000701c221d7$656f8d90$[EMAIL PROTECTED]">news:000701c221d7$656f8d90$[EMAIL PROTECTED]...
 I had to retool all of my scripts. =/

This is probably too late but one can use extract($_POST) or similar at
the beginning of a script to create those variables.  I presume $_SERVER
works as well.

 - Steve Yates
 - Peace.  (subject to change without notice)

/ Taglines by Taglinator - www.srtware.com /





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] $DOCUMENT_ROOT behavior linux vs solaris

2002-03-20 Thread Alexander Skwar

»Dennis Moore« sagte am 2002-03-20 um 02:14:16 -0500 :
 So when I build my paths I get an extra /.  Is there any way to make Sun version 
to work like the Linux version.   I hate to go back and change all my code.

Uhm, is the double / a problem?  On Linux, it doesn't seem to hurt.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 2 days 21 hours 25 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] $DOCUMENT_ROOT behavior linux vs solaris

2002-03-19 Thread Dennis Moore



I use the $DOCUMENT_ROOT environment variable quite 
ofter to build an absolute path to files in the web tree. I just ran into 
a problem moving my code from a linux box (RH6.2) to a SunW Ultra 
60. Both machines are running the same version of Apache 1.3.20 and 
PHP4.0.6. Here's the rub.

On the sun, $DOCUMENT_ROOT would add a 
slash at the end of the line where as the linux box would not.

For example:
Linux $DOCUMENT_ROOT: 
/www/dir/htdocs
Sun $DOCUMENT_ROOT: 
/www/dir/htdocs/

So when I build my paths I get an extra "/". 
Is there any way to make Sun version to work like the Linux version. 
I hate to go back and change all my code.

Thanks in advance...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] DOCUMENT_ROOT

2001-04-25 Thread Maxim Maletsky

Open your apache's httpd.conf file:

see anything like this on VHost configuration of the site in question?

JI Admin Database
VirtualHost 1.0.0.10
ServerAdmin [EMAIL PROTECTED]
DocumentRoot D:/JI_admin
ServerName admin
ErrorLog logs/JI_admin-error.log
CustomLog logs/JI_admin-access.log common
/VirtualHost


that   

DocumentRoot D:/JI_admin

is exactly what your 

$DOCUMENT_ROOT

should be returning.

I think that is where your problem.


Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 2:54 AM
To: PHP General Mailing List
Subject: [PHP] DOCUMENT_ROOT


Hi,
Has any got any idea why $DOCUMENT_ROOT returns /usr/local/htdocs on my home

machine but it should return /usr/local/htdocs/sitename or where ever I put 
it, but on my production machine it return what it should like 
/usr/local/sitename or whatever?

I'm trying to use it to help include files in different directories (see my 
previous post, site structure). Got any ideas about this?

Cheers,

Jord

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] DOCUMENT_ROOT

2001-04-25 Thread Jordan Elver

Thanks for the reply,
I'm not using virtual hosts on my local machine but I am on the production 
machine. What should DOCUMENT_ROOT return? I though it returns the directory 
of the current script. So if I had a site in 
/usr/local/apache/htdocs/cha/script.php then I would expect DOCUMENT_ROOT to 
return /usr/local/apache/htdocs/cha/, is that right?

Is it posible to setup a virtual host on localhost?

Cheers,

Jord

On Wednesday 25 April 2001 01:05, you wrote:
 If you are using Apache virtual host, it will set virtual host's document
 root. Is this what you want?

 Regards,
 --
 Yasuo Ohgaki


 Jordan Elver [EMAIL PROTECTED] wrote in message
 01042417535900.00987@localhost">news:01042417535900.00987@localhost...

  Hi,
  Has any got any idea why $DOCUMENT_ROOT returns /usr/local/htdocs on my
  home machine but it should return /usr/local/htdocs/sitename or where
  ever I put it, but on my production machine it return what it should like
  /usr/local/sitename or whatever?
 
  I'm trying to use it to help include files in different directories (see
  my previous post, site structure). Got any ideas about this?
 
  Cheers,
 
  Jord
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] DOCUMENT_ROOT

2001-04-25 Thread Maxim Maletsky

NO, not the directory of the current script.

the directory of your virtual host.

DOCUMENT_ROOT is your WEB ROOT

common. I gave an example... look into your apache (vHOST) DocumentRoot is
what your $DOCUMENT_ROOT is

Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


 
-Original Message-
From: Jordan Elver [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 7:03 PM
To: Yasuo Ohgaki
Cc: PHP General Mailing List
Subject: Re: [PHP] DOCUMENT_ROOT


Thanks for the reply,
I'm not using virtual hosts on my local machine but I am on the production 
machine. What should DOCUMENT_ROOT return? I though it returns the directory

of the current script. So if I had a site in 
/usr/local/apache/htdocs/cha/script.php then I would expect DOCUMENT_ROOT to

return /usr/local/apache/htdocs/cha/, is that right?

Is it posible to setup a virtual host on localhost?

Cheers,

Jord

On Wednesday 25 April 2001 01:05, you wrote:
 If you are using Apache virtual host, it will set virtual host's document
 root. Is this what you want?

 Regards,
 --
 Yasuo Ohgaki


 Jordan Elver [EMAIL PROTECTED] wrote in message
 01042417535900.00987@localhost">news:01042417535900.00987@localhost...

  Hi,
  Has any got any idea why $DOCUMENT_ROOT returns /usr/local/htdocs on my
  home machine but it should return /usr/local/htdocs/sitename or where
  ever I put it, but on my production machine it return what it should
like
  /usr/local/sitename or whatever?
 
  I'm trying to use it to help include files in different directories (see
  my previous post, site structure). Got any ideas about this?
 
  Cheers,
 
  Jord
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] DOCUMENT_ROOT

2001-04-25 Thread Jaxon

Not to beat a dead horse, but assuming a site structure like this:

/htdocs
/htdocs/modules
/htdocs/includes
/htdocs/templates

where all my PHP logic scripts are in htdocs, and all the bits and pieces
are in the other dirs, is there any way to set include_path to:

$include_path = $DOCUMENT_ROOT/config; $DOCUMENT_ROOT/includes;
$DOCUMENT_ROOT/templates;

so I can just include(filename.inc.php); where ever I am in my structure,
without worrying about putting in a relative or absolute path, AND do this
without altering the php.ini?? (cuz I may not have access to it in a shared
hosting env)

cheers,
jaxon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] DOCUMENT_ROOT

2001-04-25 Thread PHPBeginner.com

what about having an .htaccess file in each web root?
You can't have vartiables in your server's config files.


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Jaxon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 10:33 PM
To: Maxim Maletsky
Cc: PHP General Mailing List
Subject: RE: [PHP] DOCUMENT_ROOT


Not to beat a dead horse, but assuming a site structure like this:

/htdocs
/htdocs/modules
/htdocs/includes
/htdocs/templates

where all my PHP logic scripts are in htdocs, and all the bits and pieces
are in the other dirs, is there any way to set include_path to:

$include_path = $DOCUMENT_ROOT/config; $DOCUMENT_ROOT/includes;
$DOCUMENT_ROOT/templates;

so I can just include(filename.inc.php); where ever I am in my structure,
without worrying about putting in a relative or absolute path, AND do this
without altering the php.ini?? (cuz I may not have access to it in a shared
hosting env)

cheers,
jaxon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] DOCUMENT_ROOT

2001-04-25 Thread Dan Lowe

Previously, Jordan Elver said:

 I'm not using virtual hosts on my local machine but I am on the production 
 machine. What should DOCUMENT_ROOT return? I though it returns the directory 
 of the current script. So if I had a site in 
 /usr/local/apache/htdocs/cha/script.php then I would expect DOCUMENT_ROOT to 
 return /usr/local/apache/htdocs/cha/, is that right?

No, if you want to fetch that then do this:

$my_directory = dirname($PHP_SELF);

If you don't have register_globals on then you might have to do this
instead:

$my_directory= dirname($HTTP_SERVER_VARS['PHP_SELF']);

Should end up with /usr/local/apache/htdocs/cha in $my_directory (in this
particular case).

$DOCUMENT_ROOT is whatever your httpd.conf file says DocumentRoot is.
Even if you don't use virtualhosts, there should be a DocumentRoot in one
of your Apache config files.  I believe Apache will complain loudly on
startup if that parameter is missing.

 -dan

-- 
Plan to be spontaneous - tomorrow.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] DOCUMENT_ROOT

2001-04-24 Thread Jordan Elver

Hi,
Has any got any idea why $DOCUMENT_ROOT returns /usr/local/htdocs on my home 
machine but it should return /usr/local/htdocs/sitename or where ever I put 
it, but on my production machine it return what it should like 
/usr/local/sitename or whatever?

I'm trying to use it to help include files in different directories (see my 
previous post, site structure). Got any ideas about this?

Cheers,

Jord

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] DOCUMENT_ROOT

2001-04-24 Thread Yasuo Ohgaki

If you are using Apache virtual host, it will set virtual host's document root.
Is this what you want?

Regards,
--
Yasuo Ohgaki


Jordan Elver [EMAIL PROTECTED] wrote in message
01042417535900.00987@localhost">news:01042417535900.00987@localhost...
 Hi,
 Has any got any idea why $DOCUMENT_ROOT returns /usr/local/htdocs on my home
 machine but it should return /usr/local/htdocs/sitename or where ever I put
 it, but on my production machine it return what it should like
 /usr/local/sitename or whatever?

 I'm trying to use it to help include files in different directories (see my
 previous post, site structure). Got any ideas about this?

 Cheers,

 Jord

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] $DOCUMENT_ROOT

2001-01-29 Thread Toby Miller

Whenever I include files in Apache I always do it like this:

include($DOCUMENT_ROOT."/folder/file.php");

However, now I am doing a site in IIS and I do not have $DOCUMENT_ROOT at my disposal. 
What do most of you usually do to workaround this? Aside from installing Apache and 
Linux and bypassing the whole Windows thing :)

Thanks,
Toby




Re: [PHP] $DOCUMENT_ROOT

2001-01-29 Thread CC Zona

In article 039901c08a48$3d4b5740$[EMAIL PROTECTED], 
[EMAIL PROTECTED] ("Toby Miller") wrote:

 Whenever I include files in Apache I always do it like this:
 
 include($DOCUMENT ROOT."/folder/file.php");
 
 However, now I am doing a site in IIS and I do not have $DOCUMENT ROOT at 
 my disposal. What do most of you usually do to workaround this? Aside from 
 installing Apache and Linux and bypassing the whole Windows thing :)

Why not either include the doc root in the include_path of php.ini? Or 
define you own DOCUMENT_ROOT constant?

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] $DOCUMENT_ROOT

2001-01-29 Thread Jonathan Sharp

define('DOCUMENT_ROOT', 'C:\path\to\document\root');
NOTE! This would define a global variable to all your scripts without the $
dollar sign.

include(DOCUMENT_ROOT."/folder/file.php");

-Jonathan Sharp

Director of Technology - Imprev Inc.
Renwick Development Group - Flyerware
http://www.flyerware.com/
Phone: (425)688-9200
Cell: (425)766-1398
EPage: [EMAIL PROTECTED]

-Original Message-
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] $DOCUMENT_ROOT


In article 039901c08a48$3d4b5740$[EMAIL PROTECTED],
[EMAIL PROTECTED] ("Toby Miller") wrote:

 Whenever I include files in Apache I always do it like this:

 include($DOCUMENT ROOT."/folder/file.php");

 However, now I am doing a site in IIS and I do not have $DOCUMENT ROOT at
 my disposal. What do most of you usually do to workaround this? Aside from
 installing Apache and Linux and bypassing the whole Windows thing :)

Why not either include the doc root in the include_path of php.ini? Or
define you own DOCUMENT_ROOT constant?

--
CC

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]