Answer the question
In order to leave comments, you need to log in
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);
?>
Answer the question
In order to leave comments, you need to log in
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.
This method can be called with a user access key obtained in the Standalone application via Implicit Flow. Permissions required : status.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question