This is not a Webmin bug or issue, but rather a request for support on how to go about solving my problem. It is specific to Virtualmin. I'm not a developer, I know nothing about PHP at all. (But I do cook a mean omelette :) )
I'm trying to install WHMCS, using a South African domain registrar called domains.co.za
Their documentation states the following
- Update your domainDotCOZA scheduled crons. (Every 15 minutes) : /usr/bin/php-cli </path/to/your/whmcs>/modules/registrars/domainsDotCOZA/tools/domains_sync.php --poll &> /dev/null (Every 12 hours) : /usr/bin/php-cli </path/to/your/whmcs>/modules/registrars/domainsDotCOZA/tools/domains_sync.php --sync &> /dev/null
There is no path such as /usr/bin/php-cli in my debian 8 virtualmin install.
Feeling brave, I went ahead and tried this:
/usr/bin/php-cgi /home/automatic/public_html/whmcs/modules/registrars/domainsDotCOZA/tools/domains_sync.php --sync &> /dev/null
Which didn't work. Instead of something fun and awesome, I got this:
Content-type: text/html; charset=UTF-8 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.
Irony: WHMCS requires Ioncube and so it is installed. I'm now officially lost
If anyone can assist me, I'll send you a video of me making an omelette while singing the South African anthem.
Comments
Submitted by andreychek on Fri, 02/17/2017 - 14:37 Comment #1
Howdy -- you may want to try a command such as this:
PHPRC=/home/USERNAME/etc/php5 php -q /home/USERNAME/public_html/whmcs/admin/cron.php
Modifying the exact WHMCS script to be executed, but you get the idea... the PHPRC portion in front of that will ensure that it's using that particular domain's php.ini file.
You mentioned that you don't have the php-cli binary, you can install that with this command:
apt-get install php5-cli
Submitted by h4ns3n on Fri, 02/17/2017 - 22:27 Pro Licensee Comment #2
Thanks Eric
My apologies. Too much joking and not enough facts:
I meant to say There is no path (despite having php5-cli installed) such as /usr/bin/php-cli in my debian 8 virtualmin install
I'll try the info above, thank you, but what do I do about the bits which say --poll and --sync? I had tried something previously but if I include those, the cron job fails.
Submitted by andreychek on Sat, 02/18/2017 - 08:48 Comment #3
You may just want to try "/usr/bin/php" as the path to PHP, that should do the trick.
When using --poll or --sync, are you receiving a particular error when the cron job fails?
Submitted by h4ns3n on Sat, 02/18/2017 - 13:01 Pro Licensee Comment #4
Problem solved. Using --poll on the end of your suggested command worked perfectly!
PHPRC=/home/USERNAME/etc/php5 php -q /home/USERNAME/public_html/whmcs/admin/cron.php --poll
Thank you very much!
Submitted by JamieCameron on Sat, 02/18/2017 - 13:31 Comment #5
Odd that the
--poll
flag is needed - the WHMCS docs at http://docs.whmcs.com/Crons don't mention it.Submitted by h4ns3n on Fri, 02/24/2017 - 00:57 Pro Licensee Comment #6
I think i may have confused myself and everyone else reading this. The issue was related a specific registrar process not necessarily related to cron.php
Adding --poll to the command below is the actual command that I was having issue with. Sorry for using the wrong command in my example.
To clarify:
This command failed in cron:
/usr/bin/php-cgi /home/USERNAME/public_html/whmcs/modules/registrars/domainsDotCOZA/tools/domains_sync.php --poll &> /dev/null
This command worked:
PHPRC=/home/USERNAME/public_html/whmcs/modules/registrars/domainsDotCOZA/tools/domains_sync.php --poll &> /dev/null
Submitted by JamieCameron on Fri, 02/24/2017 - 18:07 Comment #7
Ah, ok. That's not actually a cron job that Virtualmin sets up.