Howto build php 5.3.x (cgi) 5.2.x (cli)

Howto build php 5.3.x (cgi) 5.2.x (cli)

This is the config I ended up with (cloudlinux option is optional by the way):

installation

Code:

After the build script finishes, it tries to restart apache, but can’t because libphp6.so cannot be found, this is likely because the build script has libphp6.so hardcoded somewhere and because we’re using that to cheat our way through this procedure, we can use sed to fix it;

Code:

switching using a .htaccess
Switching from the default can now be done with a .htaccess in a users’ public_html dir.

Code:

ioncube loader
If you also want to add ioncube support to the 5.2 module, you need a workaround in order to be able to build ioncube as well.

Code:

using pecl
Setting up pecl is easy too, just need to point it to the right config file:

Code:

Then you can use either pecl to install modules like apc, imagemagick, etc.

final result

Code: