Answer the question
In order to leave comments, you need to log in
How to avoid error 500 when working with VK API?
Hi people.
I have such a problem, when working with vk api through php, an error 500 crashes when the request cannot be completed.
Now more.
I use the official VKSDK PHP library, and when I use, for example, the method to display statistics for a group (not to my own, i.e. I do not have the right to request statistics), my browser gives an error 500. The
request is correct, because. when requesting your group's "All is well" statistics.
Does anyone know how to fix this?
And maybe there are better libraries for working with all methods?
Thank you all in advance. I'll attach the code if needed.
Code example.
<?php
require __DIR__ . '/vendor/autoload.php';
$vk = new VK\Client\VKApiClient('5.87');
$access_token = 'ХХХХХХХХХХХХХХХ';
if ($_POST['submit']){
$response = $vk->groups()->getById($access_token, array(
'group_ids' => array($_POST['group'])
));
echo "<pre>";
print_r($response);
echo "</pre>";
}
?>
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<title>Информация о группе</title>
</head>
<body>
<form action="" method="post">
<input type="text" name="group">
<input type="submit" name="submit" value="Отправить">
</form>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question