Custom PHP Compilation for DreamHost

I have been playing around with Symphony CMS the past one week (I’m kinda bored of WordPress). I use Dreamhost for all my hosting needs. Dreamhost is also one of the recommended hosts for Symphony, but has a low 3 star rating. I soon figured out why – one of the core symphony features called ensemble doesn’t work on Dreamhost because PHP on Dreamhost isn’t compiled with the ZipArchive class.

I looked around Symphony forums, but couldn’t find any solution. A few Google searches later, I figured that Dreamhost allows a custom compiled PHP binary to run as PHP CGI. Also found this tutorial which shows how to compile and use a custom PHP binary. However the script is slightly outdated and since it has the dependencies and their version numbers hard-coded, the most recent versions aren’t being used. Changing it for the first time is easy enough, but to keep my copy of PHP updated over a long time would be cumbersome. Hence I decided to edit the script so that it would auto-fetch the latest versions of PHP and all its dependencies. In the process I also modularized the script so that it is easy to debug in case of a failure/compilation problem. Besides the support for ZipArchive class in php, the script also supports IMAP SSL now, which it didn’t in the original script.

You can download the script here.

Also you can refer to the tutorial which has the original script for any custom php.ini settings.

Though this script is created specifically for Dreamhost, it can be used for custom php compilation on any host with minor changes to the script. Mainly the install function ‘install_custom_php” will have to change to suit your host.

Do leave a comment to let me know if it works for you.

About Pratik Sinha

Linux Nerd, Socialist, Atheist, Adventuristic, Nature Lover, Geeky.


  1. I wonder how many shared web-hosting providers allow custom-compiled PHP binary. The long-term solution is simple – Move to 1&1 😉

    So are you liking Symphony?

    Lately I have been contemplating using either MoinMoin or DokuWiki for the mostly-static, non-blog sections of my websites. Blog will still use WP because I find it simple, easy to maintain and in most cases able to do what I want.

Leave a Reply to Varun Cancel reply