S
S
scripter2020-07-21 13:09:28
PHP
scripter, 2020-07-21 13:09:28

VK API curl/file_get_contents error?

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

$c = curl_init();
curl_setopt($c,CURLOPT_URL, "https://api.vk.com/method/status.set?text=test&access_token=0000&v=5.53");
curl_setopt($c, CURLOPT_HEADER, 0);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);     
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 0); 
curl_setopt($c, CURLOPT_TIMEOUT, 10);
$html = curl_exec($c);
curl_close($c);
var_dump($html);

?>

The script goes into infinite loading, var_dump returns bool(false). I tried a lot of options, did not help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nokimaro, 2020-07-21
@scripter

to see the error
var_dump(curl_error($c));
99% chance that there will be a "connect timout" due to the fact that the ip (server) is banned by VK and either using a proxy or changing the host will help here.

A
Alexey Sundukov, 2020-07-21
@alekciy


This method can be called with a user access key obtained in the Standalone application via Implicit Flow. Permissions required : status.

https://vk.com/dev/status.set

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question