Managing PHP 5.4 Extensions on Ubuntu

My shiny new VPS* runs Ubuntu 12.10 (official subtitle: Quantal Queztal. Local nickname: Quirky Kestrel) and therefore has PHP 5.4 installed. It’s very new so every command I type is missing, and today I realised that included a PECL module (pecl_http, of course). So I aptitude install php5-pear and then get tangled in dev packages (clue: look which libcurl you have already installed to figure out which of a long list of -dev packages to choose), managing finally to emerge with a pecl install http that completes successfully with the words:

configuration option "php_ini" is not set to php.ini location
You should add "extension=http.so" to php.ini

I’ve been using Ubuntu for some time however, and we don’t put settings straight into php.ini, there’s a directory called /etc/php5/conf.d/ where all the various module configurations live, or you can enable things just for when PHP is called by apache or from the CLI. However today I hopped into /etc/php5/ and saw this:

.
├── apache2
├── cli
├── conf.d
└── mods-available

Hmmm … mods-available ? Continue reading