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 successful Stripe payment into a delivered license.
composer require permitcore/sdk
<?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 the sale. Your customer checks out in your branded Store and receives a working license automatically.
- 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.
composer require permitcore/sdk- 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 Stripe account, add the product to your branded PermitCore Store, and publish. Checkout creates the license and delivers it to the customer without a webhook project or a second commerce platform.
- Create a Store listing and pricing
- Connect the vendor Stripe account
- Publish the checkout
- Let payment create and deliver the key
One checkout completes the sale and delivers the license.
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.