【发布时间】:2015-03-18 01:04:14
【问题描述】:
此错误仅出现在我的在线网络服务器上。我正在使用更新的 cacert.pem 并在我的本地主机服务器的 php.ini 文件中引用它。
我的问题是如何在典型的 Web 服务器上完成此操作? (我的意思是通过php.ini 引用cacert.pem)
或者,有没有一种方法可以在我的函数或我正在使用的通过 composer 安装的 Mailchimps API 函数中定义它?
我目前的功能:
bootstrap.php
require_once __DIR__ . '\..\..\lib\Cake\Network\Http\HttpSocket.php';
控制器:
//////////////////////////MAILCHIMP///////////////////////
$Socket = new HttpSocket(array('ssl_cafile' => CAKE . 'Config' . DS . 'cacert.pem', ));
$api_key = "xxxxxxxxxxxxxxxxxxxxxxxx";
$list_id = "xxxxxxxxx";
$merge_vars = array('FNAME'=>$this->request->data['Subscriber']['first_name'], 'LNAME'=>$this->request->data['Subscriber']['last_name']);
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
$subscriber = $Mailchimp_Lists->subscribe($list_id, array('email' => $this->request->data['Subscriber']['email']), $merge_vars);
/////////////////////////////////////////////////////////////
【问题讨论】: