Error:
You get a License Invalid ** Trial Mode ** error on your Gateway Log when the WHMCS cron job runs, but you have a perfectly valid License Key. This is a Known Error.
Cause:
This is caused by the fact our licensing server validates the domain name where the module is installed. Using the CLI method ( php -q /absolute-path-to-cron-folder/cron.php
) to run the cron makes it unable to validate the domain name at execution, so License Invalid ** Trial Mode ** error on your Gateway Log is triggered.
Solution:
Make sure you are using the wget
or curl
commands instead of the default php
command. We suggest curl
as first option, wget
as second option.
For this to work, /crons folder must be web accessible. Sorry, you can't move it to a private location!
Examples for your WHMCS cron job command:
You can use:
curl -s http://domain-name/path-to-ron-folder/cron.php
(requires CURL to be installed in your system)
You can also use:
wget -q -O /dev/null http://domain-name/path-to-cron-folder/cron.php
(requires WGET to be installed in your system)
For WHMCS 7 this solution has been tested and works!
WHMCS 7 appears to block cron requests by automated tools for security. We must add headers and Browser User Agent.
wget -q -O /dev/null --header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" http://domain-name/path-to-ron-folder/cron.php
or
curl -s -H "Accept: text/html" -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" http://domain-name/path-to-ron-folder/cron.php
Security Note:
We understand exposing your crons directory may cause concern, we need to enforce our anti-piracy protection, but fear not, there is a solution.
Restrict Access by IP using an .htaccess file in the crons directory.
For increased protection, restrict access to a specific set of IPs. This is done by creating a file with the name .htaccess within your WHMCS crons directory, with the following content:
order deny,allow
allow from [your-server-ip]
allow from [your-server-ip]
deny from all
Only one allow from line is sufficient, unless you have more IPs.
You can specify as many different allow from lines as you require. Or you can even allow entire IP subnet's by specifying just the first part of an IP, for example: "12.34.". This is called Htaccess IP Restriction.