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.

CronJob with php version 5.6

Discussion in 'General Discussion' started by Pandax, Aug 23, 2016.

Tags:
  1. Pandax

    Pandax Registered

    Joined:
    Aug 23, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    italy
    cPanel Access Level:
    Root Administrator
    Hi,
    I have set php version 5.6 in php configuration (default is 5.4)
    in order to use PHP: array_filter - Manual

    All ok on php site
    but not in cronjob

    I created a cron:

    cd /home/xxxxx/public_html/backend/cronjob/; php cron.php

    but it fails and returns error <b>Warning</b>: array_filter() expects at most 2 parameters, 3 given in.... (feature available only from php version 5.6)

    I tried to force cron to use php version 5.6 with

    /opt/php56/lib/php -q /home/xxxxxx/public_html/backend/cronjob/cron.php

    but I get the error
    /usr/local/cpanel/bin/jailshell: /opt/php56/lib/php: is a directory

    how can I use php version 5.6 with cron?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Please try using a command like this for your cron job if you are using EasyApache 4 with PHP 5.6 installed:

    Code:
    /opt/cpanel/ea-php56/root/usr/bin/php-cgi /home/xxxxxx/public_html/backend/cronjob/cron.php
    You can find additional discussion of this topic at:

    EasyApache 4 Cron Issue

    Thanks!
     
Loading...

Share This Page