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!

PHP-cli error

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

Tags:
  1. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    77
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. JacobPerkins

    JacobPerkins Well-Known Member

    Joined:
    May 2, 2014
    Messages:
    619
    Likes Received:
    96
    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:
    77
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Thanks Jacob cP. I convey our developer. Hope it will help
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    77
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. canou83

    canou83 Well-Known Member

    Joined:
    Jul 20, 2016
    Messages:
    77
    Likes Received:
    7
    Trophy Points:
    8
    Location:
    France
    cPanel Access Level:
    Website Owner
    Work fine. Thanks all.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelMichael likes this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice