How to compile PHP source code in PHP 5.4

I was looking for a way to compile the PHP source code and use it in a PHP script by loading the compiled code. While there is no result, a small attempt to use bcompiler, but it does not compile due to changes in the Zend kernel API, it may be necessary to replace small parts.

Another attempt without success was to use phpc, the recommended version for the compiler is PHP 5.2, so the API no longer supports the changes in 5.4.

+4
source share
3 answers

bcompiler works before PHP 5.3. I am currently using it, and now I cannot upgrade to PHP 5.4 because it is not supported.

Here is a patch to make it work with Ubuntu 12.04 with a Suhosin patch.

+1
source

Roadsend Raven could be an alternative to phpc

+1
source

I believe the function of Facebook Hiphop is to compile PHP in C ++, so it’s worth checking out ... https://github.com/facebook/hiphop-php/

+1
source

Source: https://habr.com/ru/post/1442869/


All Articles