F
F
Fragman2017-01-02 18:49:07
PHP
Fragman, 2017-01-02 18:49:07

Connection refused why?

$vkuserjson = file_get_contents("https://api.vk.com/method/users.get?uids=".$vk_uid."&access_token=".$vk_access_token."&fields=uid,first_name,last_name,photo");

when trying to make this request to hostinger, a connection refused error occurs,
while this function works:
$vkjson = file_get_contents("https://oauth.vk.com/access_token?client_id=".$APPID_VK."&client_secret=".$SECRETKEY_VK."&code=".$_GET['code']."&redirect_uri=".$sitedomain."");

doing it through curl is not an option
, but when you try to open this url in the browser, it gives out all the information
. Also, if you make a request through openid on steam, then everything works

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Zhilyaev, 2017-01-03
@Fragman

If a free TP is used, then API requests cannot be made. And in curl, the headers are disabled.

Z
Zakhar Storozhuk, 2017-01-03
@Phell

Perhaps the hosting has blocked outgoing connections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question