Search code examples
phpcompilationphp-extension

Compile PHP source code into extension (.so / .dll)


Is there a way to make one of my PHP API libraries compiled into PHP extensions? I don't want my client see the source code of that PHP API.

I searched and found the same, BUT with Cython (of Python): How to protect and compile python source code into a .so library?

Thanks!


Solution

  • The sort-of equivalent in PHP-world is "HipHop for PHP", which takes PHP code, translates it into C++, and compiles it. This, of course, adds dependency requirements to any web server that's using your library.

    Linky: https://github.com/facebook/hiphop-php/wiki