Closed-Source PHP Code

I’ve been working on a large commercial platform for the past 2 years. I am getting ready to begin selling it. Before I do this I wanted to look into the options available for delivering the code as close-source. I found an article on sitepoint

However, this article is 5 years out of date and wanted to post in the forums to find out what everyone is using in 2011.

If possible, lets avoid the Open-Source PHP debate. I’m aware of the pros/cons, but its important this platform is delivered as closed-source.

I look forward to any suggestions/reviews the sitepoint community may be able to offer on this subject.

I doubt the techniques or technology have changed much in 5 or 6 years. They all essentially obfuscate and encrypt your code, both of which can be decoded and restored to original form by someone determined enough.

Variable names, functions, classes must remain due to the dynamic nature of PHP. In more static languages, you might get away with renaming a variable first_name to JDHJDH7763 as part of the obfuscation process, but with PHP and variable variables, doing so could potentially cause bugs/breakages in your applications introduced by the obfuscator.

If you application is that top secret keep it hosted (SaaS)


If you write your code according to 5.2 limits and avoid using eval or create_user_function at all you can use HipHop. Developed by the Facebook team, it turns PHP into C++ and then compiles it.

That said, if HipHop gains traction it’s going to fork of PHP main because PHP is finally embracing language constructs, such as closures, that are difficult to impossible to implement in a compiled runtime context.

I’ve been using ioncube. Primarily because there’s an online encoder that only charges a few bucks per encode, rather than getting the full $200 package. If you encode frequently, it may be more worthwhile to get the actual $200 program instead.