problem with pear.. help needed

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
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

problem with pear.. help needed

Post by vonnero »

I am using pear excel_spreadsheet writer to generate spreadsheet.
It works on my local server but does not work on the website.

I noticed that:
1. on the website, pear is installed on a different folder not the php folder.
2. the include('Writer.php') only works if i comment out these two codes for the pear Writer.php file:

require_once 'PEAR.php';
require_once 'Spreadsheet/Excel/Writer/Workbook.php';

please is there a way for me to point the require_once to these two files correctly?

please assistance is very appreciated.
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: problem with pear.. help needed

Post by iankent »

you need to find out where the PEAR library is installed on the server. server admins or your hosting company should be able to tell you.

it's often put in /usr/local/share/pear, /usr/local/sbin/pear or /usr/local/share, but its really up to the server admin where they put it so you'll need to ask them to be sure!

edit: you may find some useful info amongst phpinfo() output. if its installed, chances are the path to it will be in PHP's include path, so it should show up in phpinfo()

hth
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

Re: problem with pear.. help needed

Post by vonnero »

thanks for the quick response... its in:
usr/share/pear
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: problem with pear.. help needed

Post by iankent »

then you should be able to use that path within your require calls, e.g.

Code: Select all

 
require_once '/usr/share/pear/PEAR.php';
require_once '/usr/share/pear/Spreadsheet/Excel/Writer/Workbook.php';
 
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

Re: problem with pear.. help needed

Post by vonnero »

thanks but not working still. How do i use ini_set() correctly on that path? th result of ini_get is "." a period
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: problem with pear.. help needed

Post by iankent »

vonnero wrote:thanks but not working still. How do i use ini_set() correctly on that path? th result of ini_get is "." a period
why do you need to? as long as that folder is within your PHP path (look at phpinfo()) then you should be able to require it using the full path. what are you trying to ini_set()?
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

Re: problem with pear.. help needed

Post by vonnero »

many thanks to you all done now..... thanks again!
Post Reply