ErrorException: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /www/wwwroot/diaoyutong.cn/vendor/guzzlehttp/guzzle/src/Client.php:445
Stack trace
這里粘代碼或配置
$config = [
'app_id' => ''******',',
'secret' => '******',
'response_type' => 'array',
];
$app = Factory::miniProgram($config);
$symfony_request = new SymfonyRequest($request->get(), $request->post(), [], $request->cookie(), [], [], $request->rawBody());
$symfony_request->headers = new HeaderBag($request->header());
$app->rebind('request', $symfony_request);
$appInfo = $app->auth->session("033b050003vd7P19H3100Imad10b050G");
return $appInfo;```
ErrorException: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated
翻譯過(guò)來(lái)意思是 “http_build_query(): 第二個(gè)字符串類型參數(shù)傳遞null是過(guò)期的用法”。
說(shuō)明你用了比較新的php版本,某個(gè)地方用了舊的用法。
解決辦法:
降級(jí)php版本 或者升級(jí)相關(guān)代碼庫(kù)
具體升級(jí)哪個(gè)代碼庫(kù)?看報(bào)錯(cuò)目錄就知道了,報(bào)錯(cuò)目錄vendor/guzzlehttp/guzzle
,說(shuō)明是 guzzlehttp/guzzle
執(zhí)行 composer require -W guzzlehttp/guzzle ^7.5.0
升級(jí)。當(dāng)然升級(jí)可能不成功,因?yàn)镋asyWeChat可能寫(xiě)死了guzzlehttp/guzzle版本。那就升級(jí)EasyWeChat。EasyWeChat無(wú)法升級(jí)?那就手動(dòng)改下報(bào)錯(cuò)地方的源碼吧。