Best solution to protect PHP code without encryption
Obfuscating things can only inconvenience your legitimate, law-abiding customers, while the people who would would rip you off are not your target paying customers anyway. (edited out other thoughts about obfuscation)
Another suggestion for protecting your software: create a business model in which the code is an incomplete part of the value of your offering. For example, sell product licenses along with access to some data you manage on your site, or license the product on a subscription model or with customer support.
Designing a EULA is a legal matter, not a coding matter. You can start by reading some EULA text for products and websites you use. You might find some interesting details!
Creating a proprietary license is is highly flexible, and probably a subject beyond the intended scope of StackOverflow, since it's not strictly about coding.
Some parts of a EULA that come to mind:
- Limiting your liability if the product has bugs or causes damage.
- Spelling out how the customer can use their licensed software, for how long, on how many machines, with or without redistribution rights, etc.
- Giving you rights to audit their site, so you can enforce the licenses.
- What happens if they violate the EULA, e.g. they lose their privilege to use your software.
You should consult a legal professional to prepare a commercial EULA.
edit: If this project can't justify the expense of a lawyer, check out these resources:
- "EULA advice" on joelonsoftware
- "How to Write an End User License Agreement"
Protect my source code from end user
If you want a commercial solution, two of the most popular products are ionCube PHP encoder and zendguard . There are a few free solutions too like PHP protect but I haven't personally used any of them. Search for php obfuscator/encoder
to find the kind of software you require.
Is there a way to protect a php script from being used without a valid license?
No, I do not think this is actually possible. If you can't encrypt it, then there is no way to prevent someone from just removing that portion of your script. You could try to make it a pain in the butt to remove. But no matter how hard to you make it, a determined coder could always remove the license check while leaving the primary script intact.
Code encryption - encryption of a single file in a PHP script without extensions
Is there anything embedded into Php 5.5 that would work similar to MD5
password encryption?
Simple answer: No.
Every encoder I have seen (e.g. http://www.ioncube.com/) uses some kind of php extension so your code will need a special enviroment to be executable.
There are some so called obfuscators (e.g. http://www.gaijin.at/olsphpobfuscator.php is free) out there that will not encrypt your code but rename variables and functions/methods so that your code will become much harder to read.
One thing to keep in mind is that debugging errors of encrypted/obfuscated code usually is much harder, even for the developer.
How to protect my source code when deployed?
You are right, you can use Zend Encoder, Ion Cube or something like Source Guardian to encrypt your source code.
Its not really needed unless you are giving away your code and dont want people to steal it though.
What is it about your server that you think its insecure?
Related Topics
Finding N-Th Permutation Without Computing Others
Json_Encode() Escaping Forward Slashes
Execute PHP Script in Cron Job
"The Page Has Expired Due to Inactivity" - Laravel 5.5
How to Get Multiple Parameters With Same Name from a Url in PHP
Get Sum of MySQL Column in PHP
Glob() - Sort Array of Files by Last Modified Datetime Stamp
How to Get the Error Message For the Mail() Function
What Is the Purpose of the Question Marks Before Type Declaration in PHP7 (String or Int)
Delete Directory With Files in It
Efficient Jpeg Image Resizing in PHP
Why Do Some Scripts Omit the Closing PHP Tag, '≫'
What Does PHP Keyword 'Var' Do
How to Add Http:// If It Doesn't Exist in the Url
List All the Files and Folders in a Directory With PHP Recursive Function