[nycphp-talk] pear package manager

Mark Withington mwithington at
Mon Jan 31 12:00:49 EST 2005

Thanks Scott.

Guess I'm stumped with setting my include path.  In my php.ini I specify the


in my test script I use:

require_once 'Spreadsheet\Excel\Writer.php';

However, when I run the script I get the following:

Warning: main(Spreadsheet\Excel\Writer.php): failed to open stream: No such
file or directory in c:\program files\apache
group\apache\htdocs\main_branch\program_files\excel.php on line 2

Fatal error: main(): Failed opening required 'Spreadsheet\Excel\Writer.php'
(include_path='.') in c:\program files\apache
group\apache\htdocs\main_branch\program_files\excel.php on line 2

I have verified that the Writer.php file is in the director and that the
path I specify is correct. Thanks for any light you might shed.


Mark L. Withington
"eBusiness for the Midsize Enterprise"
PO Box 1354
Plymouth, MA  02362
o: 800-310-3992
f: 508-746-4973
v: 508-746-2383
m: 508-801-0181
Netscape/AOL/MSN IM: PLMresearch
mwithington at
Public Key:

-----Original Message-----
From: talk-bounces at
[mailto:talk-bounces at]On Behalf Of Scott Mattocks
Sent: Monday, January 31, 2005 11:49 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] pear package manager

Mark Withington wrote:

> Thanks Dan.  One more quick question.  When I run pear config-get php_dir
> get the following:
> c:\php10\pear
> and therefore all pear packages are loaded there via the package manager.
> I've got a feeling though, that I should be installing these in my web
> directory not my PHP directory - cause I'm getting errors when I try to
> reference these pear packages via an include or require statement.  Is my
> pear configuration correct or should I point it to another spot?

You shouldn't treat PEAR files any differently from other files that you 
would include in your script. Putting them in your web directory can be 
dangerous. I think there was a Phundamentals article about this.

You should just make sure that your include path is set properly and you 
shouldn't have any problems.

Scott Mattocks
scott at
New York PHP Talk
Supporting AMP Technology (Apache/MySQL/PHP)

More information about the talk mailing list