Skip to main content

Cron job with Json decoder issue

Comments

6 comments

  • cPanelLauren
    Does the Cron job function normally when run over the command line or does it also have an issue when run there?
    0
  • dragonFire
    Does the Cron job function normally when run over the command line or does it also have an issue when run there?

    Can I know how to run Cron job over command line? thing is if I call the file on browser, the function is working fine. ex: "https://test.example.net/folder_name/test.php"
    like this
    0
  • cPanelLauren
    You can run the cron over the command line interface by just using the command you run in the cron: /usr/local/bin/php -q /home/malin/public_html/youtube_api_test/cron_autosave_api_data.php
    0
  • dragonFire
    /usr/local/bin/php -q /home/malin/public_html/youtube_api_test/cron_autosave_api_data.php

    yeah, it's working, it will output "GET DATA API". but json_decode() is not working.
    0
  • cPanelLauren
    If there was an error with json decode on the system I would anticipate seeing an error being output when you run this. Have you run this script successfully before?
    0
  • dragonFire
    when I run the command in Terminal function will run but JSON decode() won't execute. but if I execute file directly from the browser JSON decode() is working "
    0

Please sign in to leave a comment.