
hosts 修改为 127.0.0.1 www.a.com 127.0.0.1 www.b.com
Nginx 绑定对应域名。网站都可单独访问 但通过 a.com curl post/get到 b.com 就访问超时
Curl 中加上了
curl_setopt($ch,CURLOPT_RESOLVE,[ "lvyou.myyoger.com:127.0.0.1" ]); 也是不可以。。
GuzzleHttp 也访问超时。
$client = new Client(); $request = $client->request('GET', $baseUrl, [ 'query' => $params ]); 报错信息:PHP Fatal error: Maximum execution time of 30 seconds exceeded
Curl 到外网就没问题