Re: require() in other directories?

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

 



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