PHPLicengine is a php license management system. You can try their trial version to get an idea to implement your own.