Код: Выделить всё
$client = new GuzzleHttp\Client([
'base_uri' => 'https://api.abuseipdb.com/api/v2/'
]);
...
?>
< /code>
Я получаю эту ошибку: < /p>
Uncaught Error: Class "GuzzleHttp\Client" not found
< /code>
Поэтому я установил его с помощью композитора:
Composer требуется guzzehttp /guzze < /p>
Он кажется успешным, и создается composer.json-файл: < /p>
{
"require": {
"guzzlehttp/guzzle": "^7.9"
}
}
< /code>
существует каталог поставщика /guzzehttp. vendor/autoload.php
[*] Добавить Backslash ($ client = new \ guzlehttp \ client)
[*] добавить «Использовать guzzehttp \ client as guzzehttp;» В первой строке
Все без эффекта.
Это выход композитора Show guzzlehttp/guzzle:
$> composer show guzzlehttp/guzzle
name : guzzlehttp/guzzle
descrip. : Guzzle is a PHP HTTP client library
keywords : client, curl, framework, http, http client, psr-18, psr-7, rest, web service
versions : * 7.9.3
released : 2025-03-27, 4 months ago
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source : [git] https://github.com/guzzle/guzzle.git 7b2f29fe81dc4da0ca0ea7d42107a0845946ea77
dist : [zip] https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77 7b2f29fe81dc4da0ca0ea7d42107a0845946ea77
path : /home/webpages/lima-city/pudem2024/vendor/guzzlehttp/guzzle
names : guzzlehttp/guzzle, psr/http-client-implementation
support
issues : https://github.com/guzzle/guzzle/issues
source : https://github.com/guzzle/guzzle/tree/7.9.3
autoload
files
psr-4
GuzzleHttp\ => src/
requires
ext-json *
guzzlehttp/promises ^1.5.3 || ^2.0.3
guzzlehttp/psr7 ^2.7.0
php ^7.2.5 || ^8.0
psr/http-client ^1.0
symfony/deprecation-contracts ^2.2 || ^3.0
requires (dev)
bamarni/composer-bin-plugin ^1.8.2
ext-curl *
guzzle/client-integration-tests 3.0.2
php-http/message-factory ^1.1
phpunit/phpunit ^8.5.39 || ^9.6.20
psr/log ^1.1 || ^2.0 || ^3.0
suggests
ext-curl Required for CURL handler support
ext-intl Required for Internationalized Domain Name (IDN) support
psr/log Required for using the Log middleware
provides
psr/http-client-implementation 1.0
Подробнее здесь: https://stackoverflow.com/questions/797 ... h-composer