Pandax

Registered
Aug 23, 2016
1
0
1
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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
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!