Re: require() in other directories?
| From: | Peter Lauri | Date: | Thu, 18 Nov 2004 11:45:34 +0000 |
| Subject: | Re: require() in other directories? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202404@lists.php.net to get a copy of this message | ||
But if I am working on a webserver it would try to find it in the root of my
webserver, or am I wrong?
For example I use that notation with an image:
I use this: <img src='/image/theimage.gif'>
Is this not the case for the PHP-scripting?
/Peter
"Jason Wong" <php-general@gremlins.biz> skrev i meddelandet
news:200411181654.43531.php-general@gremlins.biz...
> On Thursday 18 November 2004 16:32, Peter Lauri wrote:
> > I get the Failed to open stream, no such file in directory
> >
> > If you were in one of these folders:
> > /fr/
> > /eng/
> > And your classfile was namned classes.php and in the directory:
> > /classes/
> > And you wanted to include the classfile, how would you write it?
> >
> > I would assume: require("/classes/classes.php");
>
> No because PHP would be trying to find the 'classes' directory in the root
> level of your filesystem.
>
> The best way to deal with it would be to add /full/path/to/classes into
your
> include_path, then you can simply use include('classes.php').
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> Will you loan me $20.00 and only give me ten of it?
> That way, you will owe me ten, and I'll owe you ten, and we'll be even!
> */