Re: require() in other directories?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx> skrev i meddelandet
news:200411181654.43531.php-general@xxxxxxxxxxxxxxx
> 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!
> */

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux