Cron job won't start php7.2


I’m trying to run my chat bot with cron (every minute):

/usr/bin/php7.2 /home/admin/web/ >/dev/null 2>&1

and I got error from Cron daemon:

Cron [email protected] /usr/bin/php7.2 /home/admin/web/
Site error: the ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.

Ok, the problem is clear. But I’ve installed ionCube for php 7.2 as you can see here:

So wtf?

Just to config

Please run php7.2 /path/to/aws7.php to check if ioncube is loaded…

I could be that ioncube is loaded only in fpm. You will need to load module as well in /etc/php/7.2/cli/conf.d

1 Like

This is just a ouput of phpinfo(); what exactly happens if you trigger the script manualy? Will it also fail?

1 Like

Check if 00-ioncube-loader.ini is loaded in

If not copy




1 Like

Thanks @eris, I’ve missed that. - :beers:
Here is solution for “future generations” with this problem from scratch:

tar -xvzf ioncube_loaders_lin_x86-64.tar.gz
cd ioncube
php7.2 -i | grep extension_dir
cp /usr/lib/php/20170718
echo '' > /etc/php/7.2/fpm/conf.d/00-ioncube-loader.ini
echo '' > /etc/php/7.2/cli/conf.d/00-ioncube-loader.ini
service php7.2-fpm restart

hey @Amadex, glad you figured it out.

let me add something for other readers just to be more clear about what happened here:

when using /usr/bin/php in cron to run scripts, it will use settings and modules from the phps CLI config, while the webserver itself accesses php through FPM.
so, if you add additional modules like ioncube, you need to make sure to add them to both, your fpm and cli config (see above ;-))