tags:

views:

27

answers:

1

I installed the Mail_Mime package.

include('Mail.php');
include('Mail/mime.php');

I get the following errors:

Warning: include(Mail.php) [function.include]: failed to open stream: No such file or directory in /var/www/vhosts/domain.co.uk/httpdocs/mail_mime/index.php  on line 2

Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.:/usr/lib/php/PEAR:/usr/lib/php/modules') in /var/www/vhosts/domain.co.uk/httpdocs/mail_mime/index.php on line 2

Warning: include(Mail/mime.php) [function.include]: failed to open stream: No such file or directory in /var/www/vhosts/domain.co.uk/httpdocs/mail_mime/index.php on line 3

Warning: include() [function.include]: Failed opening 'Mail/mime.php' for inclusion (include_path='.:/usr/lib/php/PEAR:/usr/lib/php/modules') in /var/www/vhosts/domain.co.uk/httpdocs/mail_mime/index.php on line 3

the 2 files are definitely in the folders:

/usr/lib/php/PEAR/Mail.php
/usr/lib/php/PEAR/Mail/mime.php

pear list tells me that the packages required are installed and there are no missing dependencies

+1  A: 

Is it in your include path?

var_dump(get_include_path());

If it's not, try adding this before hand to add it to the include path:

at run time:

$path = get_include_path() . PATH_SEPARATOR . '/usr/lib/php/PEAR';
set_include_path($path);

Or in php.ini

include_path=".:--Whatever's here already--:/usr/lib/php/PEAR"

On a side note, if you care about it being included, why not use require_once? It'll prevent it from being included multiple times (the _once part) and causing a fatal error. It'll also prevent the execution of the rest of the code if it can't be found...

ircmaxell
The include path is set correctly
mononym
Do you have permission to read the file? Does the server?
ircmaxell
tried chmod to 777, still did not work
mononym
I got it working by changing the open_basedir values, now i just need to work out how to do that server wide (ie allow pear, tmp and webroot of current domain)
mononym