我正在将一个站点从共享主机移动到数字海洋液滴(Ubuntu 14 w / Apache)。这是一个基于Codeigniter的PHP站点。除了我们的Mandrill集成之外,该网站都在处理DO droplet。
为了缩小控制器中的其他代码,我已经整理了一个测试页面。它适用于旧主机,但在新网站上引发500错误:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Testemail extends CI_Controller {
function __construct() {
parent::__construct();
}
function index() {
require_once(APPPATH.'libraries/mandrill/Mandrill.php');
// comment out the next line and the page loads fine
$mandrill = new Mandrill('my_api_key');
// there's other code here to compose and send a message
}
}
// there's no closing ?> in a Codeigniter file
只需实例化Mandrill类就可以抛出500.库的路径是正确的。我已经确认我正在使用有效密钥,甚至创建了一个新的Mandrill密钥以防万一。 Apache日志,Codeigniter日志和Mandrill API日志中都没有任何内容。
到目前为止,我发现的所有内容都与尝试发送邮件后的500个错误有关。但是,我甚至没有那么远。我已经注释掉了所有实际的发送声明,只留下你上面看到的内容,我仍然得到了500。
Ubuntu 14.04,Apache 2.4.7,PHP 5.5.9,Codeigniter 2.2.6,Mandrill 1.0.55
编辑:我可以使用Codeigniter的电子邮件帮助程序和Mandrill SMTP设置发送邮件。出于性能原因,我更愿意使用API。但是SMTP现在会这样做。
编辑:显然我不能轻易地关闭我自己的问题。这似乎是一个Codeigniter问题,而不是Mandrill问题。我发现其他一些控制器正在抛出500.在转移过程中,我确实升级了CI,我确信现在是我麻烦的来源。