解決php7.1的中遇到的問題

在php7.1中部署微擎遇到問題 1.mysql_xxx函數不支持,修改install.php爲mysqli的寫法php

2.session讀取失敗,不是php.ini設置的問題,應該是php7.1的bug ,最終配置 memcache實現。mysql

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的上傳選項報警sql

$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
        }
相關文章
相關標籤/搜索