Setup WHMCS Module
Overview
This guide explains how to set up and configure the RC Licensing System WHMCS module for automated license provisioning and management.
Requirements
- WHMCS 7.0 or higher
- PHP 7.2 or higher
- cURL extension enabled
- Valid RC License account
- API key from RC Licensing System
Installation Steps
Step 1: Download the Module
Download the latest WHMCS License module from your account dashboard.
Step 2: Extract Files
Extract the downloaded file to your WHMCS installation directory:
unzip WHMCSLicense.zip
cp License.php YOUR-WHMCS-PATH/vendor/whmcs/whmcs-foundation/lib/License.php
Step 3: Set File Permissions
chmod 644 YOUR-WHMCS-PATH/vendor/whmcs/whmcs-foundation/lib/License.php
chown nobody:nobody YOUR-WHMCS-PATH/vendor/whmcs/whmcs-foundation/lib/License.php
Step 4: Update WHMCS Configuration
Edit your WHMCS configuration file and add:
define('RC_LICENSE_API_KEY', 'YOUR_API_KEY');
define('RC_LICENSE_MIRROR_URL', 'https://api.licensetube.com');
Step 5: Clear Cache
Clear WHMCS cache to load the new module:
rm -rf YOUR-WHMCS-PATH/templates_c/*
rm -rf YOUR-WHMCS-PATH/downloads/cache/*
Configuration
Module Settings
Navigate to Setup → Products/Services → Module Settings and configure:
| Setting | Description |
|---|---|
| API Key | Your RC Licensing System API key |
| Mirror URL | https://api.licensetube.com |
| Auto Provision | Enable automatic license provisioning |
| Auto Suspend | Automatically suspend expired licenses |
| Auto Terminate | Automatically terminate canceled licenses |
Product Configuration
Creating License Products
Create products for each license type:
- Go to Setup → Products/Services → Products/Services
- Click "Create a New Product"
- Select "Other" as the product type
- Fill in product details:
- Product Name: cPanel License
- Product Type: License
- Module: RC Licensing
- Configure pricing and billing cycles
- Save the product
Configurable Options
Add configurable options for license selection:
Option Name: License Type
Option Type: Dropdown
Values:
- cPanel
- LiteSpeed
- CloudLinux
- Imunify360
- WordPress
- Softaculous
Automation Rules
Setting Up Automation
Auto Provision
Automatically provision licenses when orders are paid:
- Go to Automation → Provisioning
- Create new rule for license products
- Set trigger: "When order is paid"
- Set action: "Provision service"
Auto Suspend
Automatically suspend licenses when they expire:
- Go to Automation → Suspension
- Create new rule
- Set trigger: "When service expires"
- Set action: "Suspend service"
Auto Terminate
Automatically terminate canceled licenses:
- Go to Automation → Termination
- Create new rule
- Set trigger: "When service is canceled"
- Set action: "Terminate service"
Client Portal Integration
License Management
Clients can manage their licenses through the WHMCS client portal:
- View license status
- Download license files
- View installation commands
- Request license renewal
Custom Client Area Template
Customize the client area to display license information:
<?php
if ($service['status'] == 'Active') {
echo 'License Status: Active';
echo 'Installation Command: ' . $service['customfields']['install_command'];
}
?>
Troubleshooting
Module Not Loading
Issue: Module doesn't appear in product configuration
Solution:
- Verify License.php is in correct directory
- Check file permissions (644)
- Clear WHMCS cache
- Verify PHP version compatibility
Provisioning Fails
Issue: Licenses not provisioning automatically
Solution:
- Verify API key is correct
- Check automation rules are enabled
- Review WHMCS error logs
- Test API connectivity manually
API Connection Error
Issue: Cannot connect to licensing API
Solution:
- Verify mirror URL is accessible
- Check firewall rules
- Verify cURL is enabled
- Test connectivity:
curl -I https://api.licensetube.com
Advanced Configuration
Custom Hooks
Create custom hooks for additional functionality:
<?php
add_hook('LicenseProvisioned', 1, function($vars) {
// Custom code after license provisioning
sendCustomNotification($vars);
});
?>
API Integration
Use the WHMCS API to manage licenses programmatically:
<?php
$command = 'GetClientsProducts';
$postData = array(
'clientid' => 123,
'status' => 'Active'
);
$results = localAPI($command, $postData);
?>
Best Practices
- Keep the module updated to the latest version
- Regularly backup your WHMCS database
- Test automation rules in a staging environment first
- Monitor provisioning logs regularly
- Use strong API keys and rotate them periodically
- Document custom configurations
Support
For WHMCS module support, please contact us through our website or check the API documentation.