Tiax
Tiax

Reputation: 269

Compile PHP to prevent "theft"?

If I create an application in java I compile it and it's hard to steal the code even if I send you the application. I know you can do it with reverse engineering and such but anyways.

If I create an application in PHP and put it on a clients server the client could copy paste the code if he or she wanted.

So my question is. Is there any convenient way to compile or somehow protect your PHP code from others even if it runs on their servers?

Upvotes: 2

Views: 1838

Answers (2)

Spudley
Spudley

Reputation: 168695

There is a PHP compiler produced by Facebook, called HipHop. See http://developers.facebook.com/blog/post/358 for more info.

However, the primary purpose of this compiler is to speed up your code, not to protect it. Compiling in itself is not a protection measure for any kind of code.

Upvotes: 1

N.B.
N.B.

Reputation: 14071

You could use IonCube to encode your files if you can afford it.

On the other hand, you could use APC to cache the bytecode and then set APC variable apc.stat to 0 and then remove your php files from the server. That way APC will always look in the cache without verifying that actual php files have changed.

You could also use HipHop to compile your code, but it's tricky to set up and more than often it doesn't compile without errors.

Upvotes: 5

Related Questions