This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this questionI've set up successfully the pear integration in codeigniter following the tutorial here:
http://codeigniter.com/wiki/PEAR_integration/
I would like to use the package Mail:
http://pear.php.net/package/Mail/
I've install it in system/application/pear with all dependences (Net/SMTP, Net/Socket, Auth/SA开发者_运维技巧SL)
When I call it ($this->pearloader->load('Mail','mail');) I got the following error:
Fatal error: Pearloader::require_once() [function.require]: Failed opening required 'Mail/mail.php' (include_path='.:/usr/share/php:/usr/share/pear:/var/www/mywebsite/system/application/pear/') in /var/www/mywebsite/system/application/libraries/Pearloader.php on line 6
The Mail/mail.php is in fact in Mail/Mail/mail.php in the package Mail from PEAR. If I put the mail.php in the upper folder or if I change the pearloader.php to include the path I got the following error:
Fatal error: Class 'Mail' not found in /var/www/mywebsite/system/application/pear/Mail/mail.php on line 51
If I add include_once("Mail.php"); in the mail.php (that I let in the correct path like I said before) it solve the problem but it doesn't sound to me a proper solution.
I don't manage to figure out how I could solve it in "an elegant way". Like I could like to don't have to touch file from the PEAR packages and I want to use pear inside my application.
Is there any geek out there :) who already had this problem and found the a better way to solve it?
I'm not a codeigniter expert but looking at the errors, " Failed opening" seems like a file permission problem. Check if the permissions are set correct for the file. (I faced a similar problem while using Zend fwk and the file permissions were the problem.)
精彩评论