7.1 php7.0 微擎_解决php7.1的中遇到的问题

在php7.1中部署微擎遇到问题

1.mysql_xxx函数不支持,修改install.php为mysqli的写法

2.session读取失败,不是php.ini设置的问题,应该是php7.1的bug ,最终配置 memcache实现。

public static function start($uniacid, $openid, $expire = 3600) {

if (empty($GLOBALS['_W']['config']['setting']['memcache']['session']) || empty($GLOBALS['_W']['config']['setting']['memcache']['server'])) {

WeSession::$uniacid = $uniacid;

WeSession::$openid = $openid;

WeSession::$expire = $expire;

$sess = new WeSession();

session_set_save_handler(

array(&$sess, 'open'),

array(&$sess, 'close'),

array(&$sess, 'read'),

array(&$sess, 'write'),

array(&$sess, 'destroy'),

array(&$sess, 'gc')

);

register_shutdown_function('session_write_close');

}

session_start();

}

3.一个curl的上传选项报警

$ch = curl_init();

// if (ver_compare(phpversion(), '5.6') >= 0) {

// curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);

// }

if (class_exists('\CURLFile')) {// 这里用特性检测判断php版本

curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);

$data = array('file' => new \CURLFile(realpath($source)));//>=5.5

} else {

if (defined('CURLOPT_SAFE_UPLOAD')) {

curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);

}

$data = array('file' => '@' . realpath($source));//<=5.5

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值