How to license and sell PHP software
Validate downloadable PHP software against the correct product, apply feature flags to editions, and let your Store turn a verified provider payment into a delivered license.
composer require permitcore/sdk:2.1.1
<?php
require 'vendor/autoload.php';
use PermitCore\PermitCoreClient;
$client = new PermitCoreClient(
'https://api.permitcore.dev'
);
$result = $client->validate(
$licenseKey,
expectedProductId: $productId
);
if (!$result->isValid) exit($result->message);From product record to paid customer
Use PermitCore for the licensing layer and Store checkout. Verified paid evidence triggers the configured license issuance and queues the delivery email; test actual delivery before launch.
- 01Create
Create the product and license policy
In Products, create the software your key unlocks. Choose its activation limit, validity, offline grace period, version range, and feature flags.
- Create the plugin or downloadable product
- Choose activations and validity
- Define paid feature flags
- Copy the product ID
- 02Implement
Install the PHP SDK and scope the key
Put license activation in the first-run flow and validation at startup. Pass your product ID so a valid key for another product cannot unlock this one.
These are application fragments: supply your own key/product variables and UI or host flow. A validation call does not register a device or reserve a floating session. Check failure before protected work. Offline use needs explicitly configured trusted public keys; follow the SDK 2.1.1 offline setup. For C++, use the vcpkg registry and pinned baseline in its installation reference, rather than assuming a built-in public port.
composer require permitcore/sdk:2.1.1- Install the official Composer package
- Activate per installation when needed
- Validate before protected operations
- Scope the key to this product
- 03Verify
Test the real validation path
Create a test key for the PHP product and call the same code from a clean installation. Then try a key from another product and confirm expectedProductId returns WrongProduct instead of granting access.
- 04Sell
Publish the product in your Store
Connect your chosen Stripe, Paddle or Lemon Squeezy account, add the product to your branded PermitCore Store, and publish. Account credentials, matching catalog prices and signed webhook configuration are required. PermitCore processes the verified payment and handles Store license fulfillment.
- Create a Store listing and pricing
- Connect the selected Store payment provider
- Publish the checkout
- Let payment create and deliver the key
Verified payment triggers license issuance and the delivery email queue.
PHP production checklist
The sample is intentionally small. Add these safeguards before making licensing part of a paid release.
- Perform checks server-side and keep the stored customer key out of public logs.
- Cache only according to your revocation and offline-grace requirements.
- Use feature flags for editions instead of distributing multiple validation secrets.
- Test shared-hosting environments with cURL, JSON, and OpenSSL extensions enabled.