# PEAR Forum :: PHP Extension and Application Repository

 FAQ   Search   Memberlist   Register
Author Message
arthurav

Joined: 14 Jun 2010
Posts: 2

Posted: Mon Jan 24, 2011 4:38 pm    Post subject: PEAR include path not working

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?
netcode

Joined: 21 Jan 2011
Posts: 3

 Posted: Mon Jan 24, 2011 5:16 pm    Post subject: 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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT + 2 Hours Page 1 of 1