I developed my project in PHP. I want to deploy my project to client machine without source code. is there any solution to protect my code from copying and editing.
Asked
Active
Viewed 806 times
0
-
PHP isn't *compiled* - it's a scripting language ... so all you have is *source code* - besides, when viewing a site written using PHP, you don't SEE the PHP - just the results of it running, so your PHP is safe from the internet – Jaromanda X Nov 04 '20 at 04:21
-
in sort NO, you cant stop to copy or edit if u gave code. – Devsi Odedra Nov 04 '20 at 04:22
-
No, you cannot do that, but you can do obfuscation of your code so that code will be difficult to read for most of your clients. – Not A Bot Nov 04 '20 at 04:23
-
https://stackoverflow.com/questions/336057/best-solution-to-protect-php-code-without-encryption – Kevin Nov 04 '20 at 04:30
-
Any tools/ softwares available to convert php code to executable and run that executable on client machine. – Mulsa Prathap Nov 04 '20 at 04:32
-
@MulsaPrathap - perhaps there are, but stack overflow is not a place to ask that sort of question – Jaromanda X Nov 04 '20 at 04:39
-
You may be able to obfuscate the project if you want to. – dan1st Nov 04 '20 at 07:15
2 Answers
0
If the PHP is running on the client's machine then there is no way to protect your source code. This is because PHP is interpreted meaning that the source code must be present at run time.
At best you can run your source through an obfuscator, but that will only make it harder for someone to steal your source, but not impossible.

Sawyer Herbst
- 152
- 3
- 12
-
Any tools/ softwares available to convert php code to executable and run that executable on client machine. – Mulsa Prathap Nov 04 '20 at 04:32
-
This isn't true; you can write an encryptor and compile it inside the binary (you have full source to php), which would require quite a bit of work to figure out. The problem with commercial encryptors is that people have written decoders so they just give you a false sense of security. – Danial Nov 11 '20 at 04:59
-
PHP is compiled, and as @Danial mentioned, there are tools that leverage this to protect PHP bytecode or modified versions of it. Simple bytecode compilation is no longer sufficient however, and features such as encrypting with algorithmic keys that depend on runtime state for their value or other non-stored key mechanisms should be used (dynamic and external keys in ionCube, not sure if any others have adopted the same idea). – Nick Nov 17 '20 at 09:28
-
decryptors for ioncube are readily available days after a new release; For a few dollars per page anyone can get your code 100% intact. – Danial Nov 17 '20 at 15:13
0
I think the best solution for your code to prevent from distribution is:
you have to run systems on your own hosting
you can encrypt and protect your source code before distribution by using other softwares:
a) sourceguardian
b) phpbolt
c) ioncube
d) zend-guard
e) ColdevProLayer

Mustafa Poya
- 2,615
- 5
- 22
- 36
-
the above softwares are opensource or commercial . please can you suggest me any opensource softwares to protect my php code – Mulsa Prathap Nov 04 '20 at 04:37
-
this (https://github.com/coldev/ColdevProLayer) one is free and you can also check this (https://www.phpclasses.org/blog/package/9574/post/1-PHP-Source-Code-Protection-Solutions.html) for more details about encryption of your php codes. – Mustafa Poya Nov 04 '20 at 04:42
-
There are Chinese decoders for all large commercial encryptors, so you're not really protecting your code from theft; you're just keeping your customers from seeing it. A good obfuscater is a better option. Even if you write your own encryptor; once someone decodes it they have your exact code. And all encryptors can be decoded if enough time is spent on it. – Danial Nov 11 '20 at 04:55