Я не очень знаком с композитором и PHP-классами, и теперь я застрял.[code] $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
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 [/code] Как это исправить?