There is no 100% way to achieve what you need. Even the source encoded with commercial encoders like IonCube (which require corresponding software installed btw, so it will restrict your potential auditory at least to managed hostings) don't guarantee to protect your code from modifications and changing the logic.
The best what you can do IMHO is:
1) Implement some logic based on $_SERVER host - i.e. make it per/domain license with allowing some "obviously" non-live domains (like containing dev. etc) - this is good practice
2) Use code obfuscator and encode some "important" piece of your code (for example model or helper class file). Try googling "php code obfuscator".
This is general direction, in fact this is the place where you everyone better figure out it's own unique path, the weirder the better >:o