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.

PHP/Cron Error -- Could not open input file:

Discussion in 'General Discussion' started by partsace, Jan 19, 2010.

  1. partsace

    partsace Active Member

    Joined:
    Jan 11, 2007
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    I am trying to run a cron job from within cPanel and I have everything set-up correctly, but when it runs I get this error:

    Could not open input file: -

    This is the cron:
    * * * * * /usr/local/bin/php - q /home/xxxxxx/public_html/cron.php

    I have it running every minute to see if the changes I have made worked, but nope. I have changed /usr/local/bin/php to 777 and cron.php to 777. I have also changed the location to /public_html/cron.php and I still get the same error, so it has to be something with /usr/local/... I have also changed the path to php and I get a 404 error saying it cannot find that file.

    Here is the error log:
    Jan 19 10:47:01 ns1 crond[15123]: (xxxxxx) RELOAD (cron/xxxxxx)
    Jan 19 10:47:01 ns1 crond[16051]: (xxxxxx) CMD (/usr/local/bin/php - q /home/xxxxxx/public_html/cron.php)
    Jan 19 10:47:03 ns1 /usr/bin/crontab[16084]: (xxxxxx) LIST (xxxxxx)
    Jan 19 10:47:03 ns1 /usr/bin/crontab[16085]: (xxxxxx) REPLACE (xxxxxx)

    I have also changed PHP 5 Handler from DSO to Cgi and still does not work.

    Any ideas will be greatly appreciated!

    Scott
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Remove the space between the hyphen and the "q" switch in the command-line (CLI) PHP options. Example:
    Code:
    /usr/local/bin/php -q /home/username/public_html/cron.php
     
Loading...

Share This Page