PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
First time PEAR user, trouble with Spreadsheet_Excel_Writer

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Installation, Upgrading & Configuration
View previous topic :: View next topic  
Author Message
Mattallyc



Joined: 16 Sep 2008
Posts: 3
Location: Cornwall - UK

PostPosted: Tue Sep 16, 2008 12:35 pm    Post subject: First time PEAR user, trouble with Spreadsheet_Excel_Writer Reply with quote

Hi All,

I've had PHP5 running for a long time on a win 2K3 server (IIS6) and very recently enabled PEAR so that I could use the Spreadsheet_Excel_Writer class.
I believe PEAR is working correctly but when I try to run the sample code at:
http://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.intro.php
I get:
[16-Sep-2008 10:55:41] PHP Fatal error: Class 'Spreadsheet_Excel_Writer' not found in C:\Inetpub\wwwroot\Database\PEAR.php on line 6
line 6 is:
$workbook = new Spreadsheet_Excel_Writer();
which comes from line 3:
require_once 'Spreadsheet/Excel/Writer.php';
I've checked that Writer.php is in the Spreadsheet/Excel folder and it is. The full path is:
C:\PHP\PEAR\Spreadsheet\Excel
Anyone got any suggestions as to why this isn't working?
Cheers,
Matt
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Tue Sep 16, 2008 8:31 pm    Post subject: Reply with quote

"C:\PHP\PEAR\" needs to be added to the include_path setting, otherwise the files cannot be found.
Back to top
View user's profile Send private message
Mattallyc



Joined: 16 Sep 2008
Posts: 3
Location: Cornwall - UK

PostPosted: Wed Sep 17, 2008 9:54 am    Post subject: Reply with quote

Thanks for the reply,

I've already got:

;***** Added by go-pear
include_path=".;C:\PHP\pear"
;*****

in my php.ini file.

Just to check that it can find the file I changed line 3 to:
require_once 'Spreadsheet/Excel/Writer2.php';
and got a different error message:
Failed opening required 'Spreadsheet/Excel/Writer2.php'
So I assume it can see the file, it just can't find the class within it.
I've checked Writer.php for the class and on line 45 there is:
class Spreadsheet_Excel_Writer extends Spreadsheet_Excel_Writer_Workbook
so the class is there.
What's missing?
Can I do a basic check to see if pear is working properly?
Thanks for any help,
Matt.
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Wed Sep 17, 2008 1:00 pm    Post subject: Reply with quote

Sorry, yes, you're right, the file can indeed be found, but not the class. Would it be possible that you have named your own files PEAR.php or Writer.php? It's weird that the message claims that the class cannot be found in PEAR.php. (Because there is indeed no such class in that file, at least not in the official version of it.)
Back to top
View user's profile Send private message
Mattallyc



Joined: 16 Sep 2008
Posts: 3
Location: Cornwall - UK

PostPosted: Wed Sep 17, 2008 1:20 pm    Post subject: Reply with quote

Thankyou Thankyou Thankyou!!!
For some reason I named the page pear.php (couldn't think of anything more imaginative) and naturally this screwed it all up.
I renamed it test.php and bingo! It worked.
Now I suppose I've got to knuckle down and start banging out some spreadsheets...
Thanks ever so much for your help.
Regards,
Matt.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Installation, Upgrading & Configuration All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software