Failed opening required FAIL -PEAR Mail

Discussion in 'PHP' started by bestrong, May 20, 2009.

  1. #1
    Hello everyone!

    I am having some trouble including the pear mail.php file

    my code is

    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    require_once "Mail.php";
    
    ...more code PHP PHP etc
    Code (markup):
    This products the error message
    
    Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/bluebeanstalk.com/httpdocs/admin/sendmail.php on line 7
    
    Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/share/pear/') in /var/www/vhosts/bluebeanstalk.com/httpdocs/admin/sendmail.php on line 7
    
    
    Code (markup):
    The include path is correct (include_path='.:/usr/share/pear/) and there are the Mail.php, PEAR.php, etc in that folder.

    I have already tried removing the trailing slash on include_path='.:/usr/share/pear/, and that did nothing different.

    Thanks so much,

    Ben
     
    bestrong, May 20, 2009 IP
  2. NatalicWolf

    NatalicWolf Peon

    Messages:
    262
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could be due to the fact the Mail.php isn't located in that directory. If it is in another directory, make sure you add that to the require's path. I am available via messenger if you need me.
     
    NatalicWolf, May 20, 2009 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    Make sure you restart apache each time you edit the php.ini file. Something's definitely not working correctly because of the "failed to open stream: No such file or directory in /var/www/vhosts/bluebeanstalk.com/httpdocs/admin/sendmail.php on line 7" error.
     
    jestep, May 20, 2009 IP
  4. bestrong

    bestrong Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the reply!

    Im sorry, how do I do that? Id love to...Im just not sure what that means? :eek:


    I made sure the file is '/usr/share/pear/Mail.php'

    So I tried:
    require "/usr/share/pear/Mail.php";
    Code (markup):

    and that produced:

    Warning: require() [function.require]: open_basedir restriction in effect. File(/usr/share/pear/Mail.php) is not within the allowed path(s): (/var/www/vhosts/bluebeanstalk.com/httpdocs:/tmp) in /var/www/vhosts/bluebeanstalk.com/httpdocs/admin/sendmail.php on line 7
    Code (markup):
    Does that shed any light on the problem?

    Thanks,

    Ben
     
    bestrong, May 20, 2009 IP