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
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...
For Plesk users using virtual hosts: don't forget to include the Directory directive in the vhost.conf in the /var/www/vhosts/yourdomain/subdomains/yoursubdomain/conf/vhost.conf when you set open_basedir to allow including the PEAR libraries
<Directory /var/www/vhosts/yourdomain/subdomains/yoursubdomain/httpdocs>
<IfModule mod_php4.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/yourdomain/subdomains/yoursubdomain/httpdocs:/tmp:/usr/share/php"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "var/www/vhosts/yourdomain/subdomains/yoursubdomain/httpdocs:/tmp:/usr/share/php"
</IfModule>
Options -Includes -ExecCGI
</Directory>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With