[SOLVED] script can't get at PEAR

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

[SOLVED] script can't get at PEAR

Post by Skittlewidth »

I had to build a site locally during a period of a fortnight where the company had no internet access (!) and I thought I'd use some PEAR extensions, having installed PEAR on my machine prior to Christmas.
Now we're back online I've checked that our server has the same PEAR packages, but my script won't run because it doesn't seem to want to include the PEAR files.

I've checked the include_path and it is .:/usr/share/pear, so i thought that

Code: Select all

include_once("HTML/Template/IT.php");
would work just as it did on my local machine.

Running get_included_files(); shows that the file has not been included and naturally the rest of the script fails.
What am I missing here? I've tried a preceding /, a preceeding ./ and even the full path but it doesn't include.
Last edited by Skittlewidth on Wed Jan 17, 2007 5:43 am, edited 1 time in total.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

I remeber having some trouble with include files when safe_mode was on at my host and not on my local machine...
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

Now you've mentioned it, safe_mode is definately turned on on the host.
Is it advisable to turn it off or will it have adverse effects elsewhere?
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

Hmm, I don't know enough about it to say 'just turn it off'.

The manual page is here: http://uk2.php.net/features.safe-mode
You may want to take a look at safe_mode_include_dir.
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

I've checked out other domains we're hosting and the only other site I know of using PEAR has safe_mode off as well, so I've followed suit and it works, thanks for the pointer.
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

Ok, so just to see if it could be done, I 've added the include_path to a vhost.conf file using

Code: Select all

php_admin_value safe_mode_include_dir ".:/usr/share/pear"
and turned safe_mode back on and that seems to work too, thanks!
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post by Grim... »

No worries - it was just a lucky guess ;)
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

lol, actually that vhost.conf file did something unexpected to loads of other domains. I got errors saying "too many connections" when it tried to connect to a database. I'm really not sure how that could happen when I didn't touch the master configurations file, and the include_path doesn't have much to do with apache connections right? Anyway, I've gone back to switching safe_mode off completely for the time being!
Post Reply