PHP Fatal error with Ioncube loader
Hosting Servers with Multiple PHP Versions
Offering various PHP versions have been come popular with almost all hosting providers. For example on ResellerClub Hosting servers, you can place a file called "usealtphp" into the /home/user/ dir and activate support for the latest PHP version (php5.3 or php5.4).
However, not all Hosting Providers are offering these "PHP switching" features correctly. If not correctly setup by the Hosting Provider, the PHP CLI (command line interface) used to execute php scripts with cronjobs still use the default installed PHP version.
If your Hosting Server has default php 5.2 and you have switched to php 5.3, then you can use ioncube encoded scripts for php 5.3 without any problem. However, for cronjob executed scripts, this will only work correctly if the CLI also has been configured to use the newer php version.
How to fix if CLI use default php
If your hosting server is not correctly setup by the hosting provider, then you need to change the path for all WHMCS related cronjob tasks. The following steps will show you how to get the correct path to use with cronjobs:
- In your WHMCS goto Utilities -> System -> PHP Info
- Locate the "Configuration File Path":
- Take note of the path (see screenshot above). For example, if the path is something like "/usr/local/altphp/lib", then copy/paste the complete string into a text file and change /lib with /bin/php. Example: /usr/local/altphp/bin/php.
- Edit now all WHMCS related cronjobs and change "php -q" with "/usr/local/altphp/bin/php -q"
Your cronjob tasks will now use the correct PHP version.
You need to change the same if you pipe support tickets:/usr/local/altphp/bin/php -q /home/username/public_html/whmcs/pipe/pipe.php