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
翻譯過來意思是 “http_build_query(): 第二個字符串類型參數(shù)傳遞null是過期的用法”。
說明你用了比較新的php版本,某個地方用了舊的用法。
解決辦法:
降級php版本 或者升級相關(guān)代碼庫
具體升級哪個代碼庫?看報錯目錄就知道了,報錯目錄vendor/guzzlehttp/guzzle
,說明是 guzzlehttp/guzzle
執(zhí)行 composer require -W guzzlehttp/guzzle ^7.5.0
升級。當然升級可能不成功,因為EasyWeChat可能寫死了guzzlehttp/guzzle版本。那就升級EasyWeChat。EasyWeChat無法升級?那就手動改下報錯地方的源碼吧。