PHP8 and guzzlehttp package

126 Views Asked by At

I have updated my local setup with PHP 8.2.13 version, my project is working fine.

I have third party API call within my project which is implemented with guzzleHttp client class. GuzzleHttp version I am using in 6.0

Before I update my PHP version it was working fine, but now its throwing error like - Connection refused for URI https://test.com

In my php.ini below is the setting - extension=openssl

Any help would be so much appreciated

  1. I tried upgrading guzzlehttp version to 7.8.1.
  2. After that I run composer self-update
  3. Next I tried with below commands - composer config --global -- disable-tls true composer config --global -- ignore-tls-errors true
  4. With GuzzleHttp class object I tried with below as well - $client = new GuzzleHttp\Client([ 'verify' => false, ]);
1

There are 1 best solutions below

1
Ivan Spirin On

Depends on development environment

XAMPP (Windows)

  1. If you installed php and then replaced the php folder in the xampp folder
  2. then rename the php-development.ini file to php.ini.
  3. launch XAMPP and in the Apache line select config -> php.ini
  4. unlock the plugins that will be needed
  5. Restart XAMPP
  6. Reinstall composer because it is tied to a certain version of php