The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron Job PHP Problems

Discussion in 'General Discussion' started by MVC, Jul 18, 2016.

  1. MVC

    MVC Registered

    Joined:
    Jul 18, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MVCA
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm currently trying to implement a few cron jobs that run PHP files, but I've run into some issues.

    The first cron job runs a PHP that downloads files from an external server. I initially used wget for this, and it worked fine.

    The remaining 4 cron jobs push the data from the downloaded files onto my SQL server. Opening the PHP manually from my browser works fine for this, but wget does not (with or without --spider). Using curl doesn't even return an error.

    I've tried using php -f -q but there seem to be issues with the path. Regardless of what path I use, I always get a "no input file specified" error. For reference, some of the paths I've tried are:

    /home/[username]/public_html/[folder1]/[folder2]/file.php

    /home/[username]/[websitename]/[folder1]/[folder2]/file.php

    /home/[username]/public_html/[websitename]/[folder1]/[folder2]/file.php

    I tried using find -ipath in case I might be getting the path wrong, but the returned path was

    /public_html/[folder1]/[folder2]/file.php

    which I've already tried, but doesn't work!

    Any ideas on what I can do here?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    670
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know the specific path you are using for the PHP binary itself?

    Thank you.
     
  3. MVC

    MVC Registered

    Joined:
    Jul 18, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MVCA
    cPanel Access Level:
    Root Administrator
    Sure! It is

    php -f -q /home/[username]/public_html/[folder1]/[folder2]/upload-levels.php
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    670
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  5. MVC

    MVC Registered

    Joined:
    Jul 18, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    MVCA
    cPanel Access Level:
    Root Administrator
    We aren't using EasyApache 4
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    670
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
Loading...

Share This Page