Welcome Guest, Not a member yet? Register   Sign In
Very weird library load error
#1

[eluser]theseamusjames[/eluser]
On my new cloud host (only one server), I can’t get my Email library to load. Checked my logs and it says “PHP Fatal error: Cannot redeclare class CI_Email in /var/www/html/system/application/config/Email.php on line 29”

I’m trying to run a simple test file:
public function email_me() {
echo '1';
$this->load->library ( 'email' );
echo $this->email->protocol;

echo '2';

$this->email->to ( '[email protected]' );
$this->email->subject ( 'Heeeeey' );
$this->email->message ( 'Oh yeaaaah?' );
echo '3';

if ( $this->email->send() )
echo 'yes';
else
echo 'no';
}

I have exactly one copy of Email.php, in my system libraries (none in application/libraries), and what’s weird is that echo of the protocol kicks back ‘sendmail’ when my email.php is set to smtp.

Also, all of the exact same code I have on my local copy works fine.

Any ideas?
#2

[eluser]alexaaaaaaaaaa[/eluser]
i think you missed the $this->email->from('[email protected]');
#3

[eluser]theseamusjames[/eluser]
yeah. but that doesn't explain the php error
#4

[eluser]alexaaaaaaaaaa[/eluser]
can you please copy paste what you have on that line config/Email.php ??
wait a second you have a file in config??? why? and most important what does it contains?
Becouse it shouldn't be there it should be in system/libraries and if the code it's something like
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package        CodeIgniter
* @author        ExpressionEngine Dev Team
* @copyright    Copyright (c) 2008 - 2009, EllisLab, Inc.
* @license        http://ellislab.com/codeigniter/user-guide/license.html
* @link        http://codeigniter.com
* @since        Version 1.0
* @filesource
*/

// ------------------------------------------------------------------------

/**
* CodeIgniter Email Class
*
* Permits email to be sent using Mail, Sendmail, or SMTP.
*
* @package        CodeIgniter
* @subpackage    Libraries
* @category    Libraries
* @author        ExpressionEngine Dev Team
* @link        http://ellislab.com/codeigniter/user-guide/libraries/email.html
*/
class CI_Email {

    var    $useragent        = "CodeIgniter";
    var    $mailpath        = "/usr/sbin/sendmail";    // Sendmail path
    var    $protocol        = "mail";    // mail/sendmail/smtp
    var    $smtp_host        = "";        // SMTP Server.  Example: mail.earthlink.net



then i suggest you to delete that file from config folder and move it to system / libraries
#5

[eluser]theseamusjames[/eluser]
Good catch - accidental upload. Nice...




Theme © iAndrew 2016 - Forum software by © MyBB