S
S
Sergey Melodin2018-04-08 00:34:39
In contact with
Sergey Melodin, 2018-04-08 00:34:39

VK API: HTTP response code said error how to deal?

I am transferring an already working bot from hosting to a virtual server. On the hosting everything works fine, on the server the HTTP response code said error is returned. Empirically found out that the error occurs when curl_init () is executed;
So this code works:

switch ($data->type) {
  case 'confirmation':
    echo secretKey;

And the subsequent call to the VK API returns this error:
function VKapi($method, $apiOpt){
  $apiOpt['access_token'] = token;
  $apiOpt['v'] = v;

    $ch = curl_init(); // ошибка проявляется здесь

So this code doesn't work:
switch ($data->type) {
  case 'confirmation':
    echo secretKey;
    VKapi(прочий_код);

On the hosting was Apache, on the server - Nginx. Perhaps some special server configuration is needed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ramazan, 2018-04-08
@melodyn

Is the php-curl package installed on the server? If not, thensudo apt install php-curl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question