Page 1 of 1

[SOLVED] script can't get at PEAR

Posted: Wed Jan 17, 2007 4:50 am
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.

Posted: Wed Jan 17, 2007 4:58 am
by Grim...
I remeber having some trouble with include files when safe_mode was on at my host and not on my local machine...

Posted: Wed Jan 17, 2007 5:02 am
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?

Posted: Wed Jan 17, 2007 5:31 am
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.

Posted: Wed Jan 17, 2007 5:32 am
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.

Posted: Wed Jan 17, 2007 5:40 am
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!

Posted: Wed Jan 17, 2007 5:45 am
by Grim...
No worries - it was just a lucky guess ;)

Posted: Wed Jan 17, 2007 6:39 am
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!