title: GuzzleHttp\Exception\ConnectException: Connection refused for URI
body: <p>I try to scrape a websites HTML code with a guzzle http-request. In the browser (chrome) everything works fine, but when I try to execute the PHP script with the console (windows) I get the following error:</p>
  <blockquote>
  <p>GuzzleHttp\Exception\ConnectException: Connection refused for URI <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a></p>
  </blockquote>
  <pre><code>$httpClient = new \GuzzleHttp\Client();
  $response = $httpClient-&gt;get(&quot;https://example.com&quot;);
  $htmlString = (string) $response-&gt;getBody();
  </code></pre>
  <ul>
  <li>I downloaded &quot;php-7.4.23-nts-Win32-vc15-x64.zip&quot; and extracted it I</li>
  <li>navigated to the folder where I extracted php I ran</li>
  </ul>
  <blockquote>
  <p>php c:\myproject\index.php</p>
  </blockquote>