If you take a look at the install manual at: http://ez.no/manual/install/install_manually
you will find information about how you need to compile PHP. Basically you only need to compile in database support and gd ( which can be skipped if you use imagemagick ).