Re: Where am I?
| From: | Jeff | Date: | Wed, 18 Dec 2002 04:15:45 +0000 |
| Subject: | Re: Where am I? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128642@lists.php.net to get a copy of this message | ||
Ok.
In the root of the Webserver (Win | Apache) I have a directory called images
and one called about.
/+root (Win=C:\Inetpub\wwwroot, Apache=/home/../../public_html
+-about
+-images
I call a page in about (/about/index.php). One this page I have a script to
open an image file and get the size. DOC_ROOT gives me /root/about. This can
go down 'x' number of levels.
How do I /root/ dir from anywhere in my site?
Jeff
"Martin Towell" <martin.towell@world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF5034D04F2@exchange.world.net...
> Doing a quick scan through the output of phpinfo() on my machine, I can
see
> any one of the following will give me the path (incl. filename of the
> current script)
>
> $HTTP_SERVER_VARS["DOCUMENT_ROOT"] . $PHP_SELF
> $HTTP_SERVER_VARS["SCRIPT_FILENAME"]
> $HTTP_SERVER_VARS["PATH_TRANSLATED"]
>
> HTH
> Martin
>
> -----Original Message-----
> From: Jeff [mailto:jkofsky@bellsouth.net]
> Sent: Wednesday, December 18, 2002 3:00 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Where am I?
>
>
> No, I've been looking all day. I can get the information is I run the
script
> from the root, but what if I am in a sub-dir?
> Jeff
>
> "Martin Towell" <martin.towell@world.net> wrote in message
>
> news:6416776FCC55D511BC4E0090274EFEF5034D04F0@exchange.world.net...
> > try doing a phpinfo() , somewhere in there it'll tell you
> >
> > Martin
> >
> > -----Original Message-----
> > From: Jeff [mailto:jkofsky@bellsouth.net]
> > Sent: Wednesday, December 18, 2002 2:34 PM
> > To: php-general@lists.php.net
> > Subject: [PHP] Where am I?
> >
> >
> > I'm using PHP 4.0.6. I am developing on Win98SE, and deployed on an
Apache
> > server.
> >
> > I need to find the actual path of the root directory.
> >
> > Windows: C:/Inetpub/wwwroot/
> > Apache: /home/dcent/public_html/
> >
> > I've tried dirname(), basename(), etc. I just can't figure it out.
> > Help.
> >
> > Jeff
> >
> >
> >
> > --
> > 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