Re: beginner with go-pear on shared host

From: Date: Thu, 08 Jul 2004 23:11:56 +0000
Subject: Re: beginner with go-pear on shared host
References: 1 2 3 4 5 6  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-13568@lists.php.net to get a copy of this message
Justin Patrin wrote:
This brings me brings me to another question. To work with pear libs that I install in my web directory does the system *have* to have the PEAR Foundation Classes installed? I know these are bundled with PHP but this ISP is having a rather non-standard configuration (register_globals on and safe mode off for instance). I don't see "'--with-pear" in the configuration command. Is there a way to find out if the PFC are installed short of calling the ISP? Thanks,
You can try require_once('PEAR.php'); Although, if you're going to be using your own packages, you should use your own version of PEAR.php and all other PEAR classes. You should be able to override the include_path setting in a .htaccess file in your web directory (assuming you're running on apache ;-) to use your own PEAR path before the ISP's include paths.
OK. I ran go-pear in a directory in on the shared host without changing any of the paths. This installed the 'bin' and 'pear' directories and the 'index.php' and the 'pear.conf' files in the same directory as the go-pear script. I moved all these files except the index.php to a directory outside the document root and changed the paths in index.php and pear.conf accordingly. The directory the pear files are in is a subdirectory of a directory 'includes' which is in the include path. Couldn't override the include path in htaccess, another peculiarity of the isp.. (Or maybe my lack of experience) However I can place a php.ini in the root of the domain so php settings are not a problem:-) After this I uploaded a script "peartest.php" with <?php require_once('PEAR.php'); ?> in it to test it. The result of the script when I run it is: Warning: main(PEAR.php): failed to open stream: No such file or directory in /export/home/domain.nl/htdocs/test/peartest.php on line 1 Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/local/php4/include/php:/export/home/domain.nl/includes') in /export/home/domain.nl/htdocs/test/peartest.php on line 1 To rule out that anything went wrong moving the files by downloading editing the paths and uploading I removed the installed files and ran go-pear again this time I changed the paths so the files got installed outside the document root and the frontend in the test directory in the document directory. This didn't fix it. Next I added the path to the PEAR files to the include path even though the an ancestor directory of the PEAR files is already in the include path. Like so: include_path='.:/usr/local/php4/include/php:/export/home/domain.nl/includes:/export/home/domain.nl/includes/PEAR/PEAR' This time the test script produces no output so I gues that is good news. I just wonder, shouldn't subdirectories of directories that are in the include path also be searched for includes? Anyway I gues I can go on and see If can get my scripts working. Thanks for the support, Steven

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