wenjian337 发表于 2014-6-7 16:57:42

CI 配置文件格式问题

支付宝接口开发中,使用了论坛的帖子,alipay.php的配置文件格式如下

//签名方式 不需修改
$alipay_config['sign_type']    = strtoupper('MD5');

//字符编码格式 目前支持 gbk 或 utf-8
$alipay_config['input_charset']= strtolower('utf-8');

//ca证书路径地址,用于curl中ssl校验
//请保证cacert.pem文件在当前文件夹目录中
$alipay_config['cacert']    = getcwd().'\\cacert.pem';

//访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
$alipay_config['transport']    = 'http';

在 使用时使用如下方法
$this->config->load('alipay', TRUE);

$alipay_cnf = $this->config->item('alipay');
产生如下错误

An Error Was EncounteredYour application/lulubao/config/alipay.php file does not appear to contain a valid configuration array.
是不是配置文件里只能写这样格式的
$config['cacert']=""

57sy.com(隐身中 发表于 2014-6-11 10:02:44

对 只能那样的格式的

57sy.com(隐身中 发表于 2014-6-11 10:03:30

你可以这样啊
$config['zhifubao'] = $alipay_config ;
页: [1]
查看完整版本: CI 配置文件格式问题