A
A
Albert2016-10-12 18:00:43
PHP
Albert, 2016-10-12 18:00:43

Why are requests to VK api not executed via Cron?

There is a PHP code that, using the VK api, gets the number of friends of the desired user and makes an entry in the database.
The code works fine because I turn to the script through the browser and it does everything as it should.
I put the script in the list of cron tasks and realized that it does not fulfill requests to api vk, because. the line appears in the database, but the number of friends is 0.
Tell me how to solve the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
romy4, 2016-10-12
@romy4

for cron, output errors to a file instead of /dev/null

V
VisualIdeas, 2016-10-12
@VisualIdeas

Colleague, check if the code uses environment variables?
Look at the php errorlog

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question