Installation Guidance

This module consists of two components that work together: a Server Module (provisioning engine) and an Addon Module (admin dashboard). Both must be installed for full functionality.

Step 1 — Upload Module Files

Extract the package and upload the two module directories to your WHMCS installation:

<whmcs_root>/
├── modules/
│   ├── addons/
│   │   └── licensingmanager/          ← Admin Dashboard (Addon Module)
│   │       └── licensingmanager.php
│   │
│   └── servers/
│       └── licensemgr/               ← Provisioning Engine (Server Module)
│           ├── licensemgr.php
│           ├── hooks.php
│           ├── api/
│           │   ├── validate.php       ← Public license validation API
│           │   └── standalone_init.php
│           ├── lib/
│           │   ├── LicenseGenerator.php
│           │   ├── LicenseValidator.php
│           │   ├── ReissueManager.php
│           │   └── DownloadManager.php
│           ├── sdk/
│           │   ├── check_license.php  ← Drop-in SDK for your apps
│           │   ├── LicenseClient.php  ← OOP SDK for frameworks
│           │   └── README.md
│           ├── templates/
│           │   └── clientarea.tpl     ← Client Area template
│           └── lang/
│               └── english.php

Step 2 — Set File Permissions

Ensure your web server can read the module files. On Linux/cPanel servers, run:

chmod -R 755 /path/to/whmcs/modules/addons/licensingmanager/
chmod -R 755 /path/to/whmcs/modules/servers/licensemgr/

Step 3 — Activate the Admin Dashboard

  1. Navigate to System SettingsAddon Modules in your WHMCS Admin Panel.
  2. Locate “Licensing Manager” and click Activate.
  3. Click Configure, enter your module license key, and grant access to the relevant administrator roles (e.g., Full Administrator).
  4. Click Save Changes.

Note: Database tables (mod_licensemgr_licenses, mod_licensemgr_validations, mod_licensemgr_reissues, mod_licensemgr_bans, mod_licensemgr_downloads) are automatically created via the WHMCS Capsule ORM when the module is first accessed.

Step 4 — Create a Licensed Product

  1. Navigate to System SettingsProducts/Services.
  2. Create a new product or edit an existing one (e.g., “My Premium PHP Script”).
  3. Go to the Module Settings
  4. Select “License Manager” from the Module Name dropdown.
  5. Configure the following settings:

Setting

Description

Example

License Key Prefix

Branded prefix prepended to every key

MYAPP-

License Key Length

Character length of the unique portion

16

License Key Format

Character set (Alphanumeric, Numeric, Hex)

ALPHANUMERIC

Max Reissues

Times a client can rebind domain/IP

3

Reissue Reset Period

Days until reissue counter refreshes

30

Allowed Download IDs

Comma-separated download IDs from Support → Downloads

12,15

License Validity

Validity period (billing_cycle, fixed days, or lifetime)

billing_cycle

  1. Under Automatic Setup, select “Automatically setup the product as soon as the first payment is received”.
  2. Click Save Changes.

Step 5 — Verify API Accessibility

The validation API must be publicly accessible for your customers’ software to phone home. Verify by visiting:

https://your-whmcs-domain.com/modules/servers/licensemgr/api/validate.php

You should receive a JSON response like {"status":"error","message":"License key is required."}. This confirms the API is reachable.

Important: Ensure your firewall or .htaccess rules do not block POST requests to this endpoint.

Step 6 — Integrate the SDK into Your Software

Copy the appropriate SDK file from modules/servers/licensemgr/sdk/ into the application you are distributing:

Option A — Simple Drop-in (Recommended for most apps): 1. Copy sdk/check_license.php into your application. 2. Edit the configuration variables at the top ($whmcs_url, $license_key). 3. Require it at the top of your protected files:

<?php
require_once 'check_license.php';
if (!$licenseValid) {
    die('A valid license is required to run this application.');
}

Option B — OOP Integration (For Laravel, Symfony, etc.): 1. Copy sdk/LicenseClient.php into your application. 2. Instantiate and use it:

<?php
use LicenseManager\LicenseClient;
$license = new LicenseClient('https://your-whmcs-domain.com', $licenseKey, 'your_secret_key');
if (!$license->isValid()) {
    die('Invalid license.');
}

Step 7 — Access the Dashboard

Navigate to AddonsLicensing Manager in the WHMCS admin navigation to view the Dashboard, browse licenses, manage bans, review validation logs, and access the Integration reference

Was this answer helpful? 0 Users Found This Useful (0 Votes)