在localhost上,网站运行正常。 但是当我上传到hosting =>它返回HTTP错误500(内部服务器错误)
如果我在库上调用不可用的库或调用不可用的函数(它不会返回任何错误,只是空白页),结果相同
示例:
class My_Email extends CI_Email{
public function sz_send($to,$bcc,$subject,$content)
{
$CI =& get_instance();
// get config
$CI->load->model('config_model');
$site_config = $CI->config_model->getconfig();
// init mail
$mail_config['protocol'] = 'smtp';
$mail_config['smtp_host'] = $site_config['mail_host'];
$mail_config['smtp_port'] = $site_config['mail_port'];
$mail_config['smtp_user'] = $site_config['mail_user'];
$mail_config['smtp_pass'] = $site_config['mail_pass'];
$mail_config['charset'] = 'utf-8';
$mail_config['mailtype'] = 'html';
$mail_config['wordwrap'] = TRUE;
$mail_config['smtp_timeout'] = '7';
$mail_config['newline'] = "\r\n";
$mail_config['validation'] = TRUE;
$CI->load->library('email');
$CI->email->initialize($mail_config);
$CI->email->from($site_config['mail_user'], $site_config['mail_name']);
$CI->email->to($to);
$CI->email->bcc($bcc);
$CI->email->subject($subject);
$CI->email->message($content);
if($CI->email->send()){
return TRUE;
} else {
//echo $CI->email->print_debugger();
return FALSE;
}
}
}
在控制器中,我打电话给:
$this->load->library('email');
$this->email->sz_send($user->email,'','Subject',$mailcontent);
使用带有Chorme
的FF和HTTP错误500(内部服务器错误)的空白页返回网站p / s:我如何在托管(linux)上看到apache日志文件?