Is it possible to install PHP 5 via aptitude?

I’m going to need to roll a version of PHP 5 with gd-enabled. As I look at this:, the latest instructions are for 5.2.5. We’ll be upgrading to squeeze so that comes with 5.3.3 and the latest PHP version is 5.3.8.


Will the instructions for 5.2.5 work with 5.3.3?
How about with 5.3.8?
Do I have to look up the versions of all the depending libraries to see which match with the version of my choice?

All of this makes me wonder if using a package manager might solve all of these issues. Has anyone tried to use aptitude to install php5 (with custom flags turned on)?

How would I use aptitude to do this? Specifically how can I tell aptitude to turn on certain flags when it builds php5?

At this point, we strongly recommend that all users who need custom PHP settings use the methods detailed at You can compile your own PHP extensions for our PHP 5.3 binary, so there’s no longer really any need to roll your own from scratch.

aptitude cannot compile PHP. It can only install a precompiled version, which will not work properly with our management system without some additional effort. We don’t recommend it.


Do you have any specific advice about enabling GD? Looking at the DH wiki pages as well as doing some scouring on the 'net, it looks like GD is a bundled component in the PHP binary. That is, I can’t find some good directions on how to compile the GD module as a separate component.

Seems like GD (as well as a host of other options) would be well-used by most DH’rs… would love to see this as part of the default install (i.e. compiled in already).



gd is already included by default in our PHP 5.3 distribution. There’s no need to do anything additional.