Failed loading IonCube from Cron Jobs (Multiple PHP Versions)

I am using Centos 7.3.
The default php installation version is 5.4.
I installed PHP 5.6 using scl-utils, and than configured the php.ini to load the IonCube module.
I have a VirtualServer with php 5.6.5 enabled as default. The script installed on this server requires php 5.6 and greater and is encoded via IonCube.
Everything is working fine as the script loads without problems under php 5.6 and php is loading the IonCube to without any problems.

The problem is that i need to setup a cron job to run under php 5.6 as well.

I tried setting up a Cron Job from the root user:
php -c /etc/opt/rh/rh-php56/php.ini /home/maxal/public_html/crons/cron.php
and i get this error :

Failed loading /opt/rh/rh-php56/root/usr/lib64/php/modules/ioncube_loader_lin_5.6.so: /opt/rh/rh-php56/root/usr/lib64/php/modules/ioncube_loader_lin_5.6.so: undefined symbol: zend_execute_ex
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.


Please visit get-loader.ioncube.com for install assistance.

So i don't know why IonCube is not loaded!


...................

I also tried Setting up a Cron Job from the Virtual Server that is using php 5.6.5
php -c /home/maxal/etc/php5.6/php.ini /home/maxal/public_html/crons/cron.php

Again i'm getting this error:
**Failed loading /home/maxal/etc/ioncube_loader_lin_5.6.so: /home/maxal/etc/ioncube_loader_lin_5.6.so: undefined symbol: zend_execute_ex PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
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.

Please visit get-loader.ioncube.com for install assistance.**

Status: 
Closed (fixed)

Comments

Assigned: Unassigned »
Status: Active » Fixed

When calling the php script using the command below everything sems to work find including IonCube: /opt/rh/rh-php56/root/usr/bin/php /home/maxal/public_html/crons/cron.php

Great, we're glad you were able to get that working!

Feel free to let us know if you have any additional questions.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.