Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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-cli error

Discussion in 'EasyApache' started by canou83, Nov 4, 2016.

Tags:
  1. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    74
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Hello. We try to run a cron job:

    php /home/xxxxxxxxxx/public_html/scripts/exploit/cron_run_alljobs.php >> /home/xxxxxxxxxxxx/public_html/documents/cron/cronjobs.log

    but in return we have this error:

    Error: You are using PHP for CGI. To execute cron_run_alljobs.php from command line, you must use PHP for CLI mode.

    I e-retailer and not specialist. Yet it seems that php-cli is installed.

    Thank you for your ideas and aids
     
  2. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    605
    Likes Received:
    94
    Trophy Points:
    103
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    Instead of calling 'php' via the cron', instead call '/usr/local/bin/php'. This is the CLI variant.

    I hope this helps!
     
  3. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    74
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Thanks Jacob cP. I convey our developer. Hope it will help
     
  4. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    74
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    One thing, if we run this command from the command line via SSH it works perfectly. But not automatic task. In automatic Error: You are using PHP for CGI. To execute cron_run_alljobs.php from command line, you must use PHP for CLI mode.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  6. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    74
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Work fine. Thanks all.
     
    cPanelMichael likes this.
Loading...

Share This Page