zoukankan      html  css  js  c++  java
  • 解决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
            }
    
  • 相关阅读:
    判断activity是否显示在界面上
    限制EditText的输入字数
    安卓自定义类似TabHost的导航栏
    安卓中加载布局文件的三种方法
    绘图——Android绘图基础:Canvas、Paint等
    使用简单图片
    使用原始资源
    MySQL分表(Partition)学习研究报告
    Docker基础知识介绍
    Python开发系列
  • 原文地址:https://www.cnblogs.com/ikodota/p/6776466.html
Copyright © 2011-2022 走看看