I created a php cron job, to fetch the Instagram feeds. My code is as follows..
$homepage = file_get_contents("https://api.instagram.com/v1/users/XXXXXX/media/recent?access_token=XXXXXXXXXX.XXXXXXX.XXXXXX&count=8", false, stream_context_create($arrContextOptions)); $json = json_decode($homepage);
When I execute this code through web-browser, it was working fine. But it was not executing from cron job.
I am using cron job command line as follows..
cd /home/MY_SITE/public_html/content/insta/ && php index.php > /dev/null 2>&1
please help me.. Thanks.
Also try to change your cron command to this
php /home/MY_SITE/public_html/content/insta/index.php > /tmp/log
and check /tmp/log
file probably there is logged some error