RE: [PEAR] directory structure when php.ini not accessible?

From: Date: Mon, 10 Feb 2003 11:45:17 +0000
Subject: RE: [PEAR] directory structure when php.ini not accessible?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3688@lists.php.net to get a copy of this message
> -----Original Message----- > From: Rasmus Jørgensen [mailto:rasmus@baseweb.dk] > Sent: Monday, February 10, 2003 12:53 PM > To: pear-general@lists.php.net > Subject: [PEAR] directory structure when php.ini not accessible? > > I've not managed to find a installation guideline for PEAR and DB package > when one do not have access to configure include_path in php.ini. > Where is it? > I've retreived the PEAR and DB tar's from > http://pear.php.net and have > placed the files in the following structure: > > myfunctions/DB.php > myfunctions/DB/ > myfunctions/PEAR/ > > and then does: > require_once ("$DOCUMENT_ROOT/myfunctions/DB.php"); > > So of course I get the errormessage that DB.php failed to include PEAR.php > as this is placed in /PEAR/, but the file assumes that /PEAR/ was part of > include_path, which is not the case as I do not have access to edit > php.ini. > > So I edit DB.php line 25: require_once "PEAR.php"; > to: > require_once "PEAR/PEAR.php"; > And know it seems DB layer works, but does it? > > Do I run into other (undiscovered) problems with this structure / editing > DB.php? > Does anyone fancy to give me feed-back on whether the placement of > files/folders is correct or if there is a structure that does not need > editing in the files downloaded from pear.php.net? yes indeed this is a problem. This should do the trick: ini_set('include_path', ("$DOCUMENT_ROOT/myfunctions"); if you don’t have access to this method (a lot of hoster disable it) things will get tricky. We introduced a set_include_path() method for this purpose, which we hope that hosters will not disable in php 4.3. So that might be an option (although I doubt many hosters have this installed yet). If all of the above fails you will need to manually fix all places where code is included/required. Use absolute paths! Relativpaths can screw up include_once/require_once! Regards, Lukas

« previous php.pear.general (#3688) next »