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.
problem with pear.. help needed
Moderator: General Moderators
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: problem with pear.. help needed
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
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
Re: problem with pear.. help needed
thanks for the quick response... its in:
usr/share/pear
usr/share/pear
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: problem with pear.. help needed
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';
Re: problem with pear.. help needed
thanks but not working still. How do i use ini_set() correctly on that path? th result of ini_get is "." a period
- iankent
- Forum Contributor
- Posts: 333
- Joined: Mon Nov 16, 2009 4:23 pm
- Location: Wales, United Kingdom
Re: problem with pear.. help needed
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 wrote:thanks but not working still. How do i use ini_set() correctly on that path? th result of ini_get is "." a period
Re: problem with pear.. help needed
many thanks to you all done now..... thanks again!