NYCPHP Meetup

NYPHP.org

[nycphp-talk] pear package manager

Mark Withington mwithington at PLMresearch.com
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
following:

include_path=.;c:/php10/PEAR

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

--------------------------
Mark L. Withington
PLMresearch
"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
http://www.PLMresearch.com
Netscape/AOL/MSN IM: PLMresearch
mwithington at plmresearch.com
Public Key: http://www.PLMresearch.com/keys/MLW_public_key.asc
Calendar: http://www.plmresearch.com/calendar.php


-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]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
I
> 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 crisscott.com
http://www.crisscott.com
http://pear.php.net/user/scottmattocks
_______________________________________________
New York PHP Talk
Supporting AMP Technology (Apache/MySQL/PHP)
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org



More information about the talk mailing list