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 
PEAR include path not working

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



Joined: 14 Jun 2010
Posts: 2

PostPosted: Mon Jan 24, 2011 4:38 pm    Post subject: PEAR include path not working Reply with quote

PEAR is not installed on my server so I had to put it manually in a folder. I put it in the includes directory in the site root. So it is site_root/includes/PEAR . I have downloaded the pear-mail extension to PEAR and tried to include it somewhere in the site this way:

Code:
set_include_path(".:includes/PEAR");
require_once("pear-mail/Mail.php");


The error I get is the following:
Code:
require_once() [function.require]: Failed opening required 'pear-mail/Mail.php' (include_path='.:/usr/lib/php; .:includes/PEAR') in I:\work\sites\my_site\directory\email.php on line 3

where I:\work\sites\my_site\ is the site root

What am I doing wrong?
Back to top
View user's profile Send private message
netcode



Joined: 21 Jan 2011
Posts: 3

PostPosted: Mon Jan 24, 2011 5:16 pm    Post subject: Reply with quote

I personally don't like to use set_include_path. I would rather put it right into php.ini

What OS are you working with? Because you need to use a colon for Unix and semi-colon for windows when listing paths in your include_path. I am assuming your on a windows machine.

I also don't like that you didn't put anything before "includes/PEAR"
I would explicitly define that path using the full path "I:\work\sites\my_site\includes\PEAR". It also works more efficiently that way anyways.

Hope this helps
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