Re: require() in other directories?

From: Date: Thu, 18 Nov 2004 08:54:43 +0000
Subject: Re: require() in other directories?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-202393@lists.php.net to get a copy of this message
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! */

« previous php.general (#202393) next »