duanluwei9374 2015-12-23 02:22
浏览 56

Mandrill PHP库在实例化时抛出500错误

I'm moving a site from a shared host to a Digital Ocean droplet (Ubuntu 14 w/Apache). It's a Codeigniter-based PHP site. The site is all working on the DO droplet, except for our Mandrill integration.

To narrow down whether its other code in the controller, I've put together a test page. It works at the old host but on the new site throws a 500 error:

<?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

Simply instantiating the Mandrill class is all it takes to throw the 500. The path to the library is correct. I've confirmed I'm using a valid key, and even created a new Mandrill key just in case. There is nothing in the Apache logs, nor in the Codeigniter logs, nor in the Mandrill API logs.

Everything I've found so far relates to 500 errors after attempting to send a message. But, I'm not even getting that far. I've commented out all the actual sending statements to leave just what you see above and I still get the 500.

Ubuntu 14.04, Apache 2.4.7, PHP 5.5.9, Codeigniter 2.2.6, Mandrill 1.0.55

Edit: I can send mail using Codeigniter's email helper and the Mandrill SMTP settings. I would prefer to use the API for performance reasons. But SMTP will do for now.

Edit: Apparently I can't easily close my own question. This is appears to be a Codeigniter issue, not a Mandrill issue. I've found some other controllers that are throwing the 500. During the transfer, I did upgrade CI which I'm sure now is the source of my troubles.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 luckysheet
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型
    • ¥50 buildozer打包kivy app失败
    • ¥30 在vs2022里运行python代码
    • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
    • ¥15 求解 yolo算法问题
    • ¥15 虚拟机打包apk出现错误