Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api php not working #7089

Open
pawel06281990 opened this issue May 7, 2024 · 1 comment
Open

api php not working #7089

pawel06281990 opened this issue May 7, 2024 · 1 comment
Labels
needs investigation An issue that needs further investigation by a developer to determine the root cause.

Comments

@pawel06281990
Copy link

Installation Method

Docker Installation

AzuraCast Release Channel

Stable Channel

Current AzuraCast Version

2024-04-26 21:38

What happened?

Hello, I wanted to make a panel for Azuracast but when I added the api from php to I got an error and I did everything correctly, I get something like this

Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 7: Failed to connect to localhost port 80: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost/api/station/1/status in /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210 Stack trace: #0 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php(47): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #4 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php(48): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #5 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #6 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #7 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #8 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Middleware.php(63): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #9 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array) #10 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Client.php(333): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array) #11 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array) #12 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync('GET', Object(GuzzleHttp\Psr7\Uri), Array) #13 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/azuracast/php-api-client/src/AbstractClient.php(54): GuzzleHttp\Client->request('GET', 'station/1/statu...', Array) #14 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/azuracast/php-api-client/src/StationClient.php(63): AzuraCast\Api\AbstractClient->request('GET', 'station/1/statu...') #15 /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/panel.php(139): AzuraCast\Api\StationClient->status() #16 {main} thrown in /home/twoj-host/web/panelradiowy.twoj-host.pl/public_html/panel/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 210

This is what my data looks like

$api = \AzuraCast\Api\Client::create( 's1.twoj-host.pl', 'a5446694e8*****:767c6ae12760a1478d***********' );

P.S The API key doesn't look like it, I added asterisks

Relevant log output

No response

@pawel06281990 pawel06281990 added the needs investigation An issue that needs further investigation by a developer to determine the root cause. label May 7, 2024
@BusterNeece
Copy link
Member

@pawel06281990 Try adding https:// to the API URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation An issue that needs further investigation by a developer to determine the root cause.
Projects
None yet
Development

No branches or pull requests

2 participants