Add custom config for PHP modules

Sets up and enables configuration for php 5.4 modules. It accepts an
optional priority parameter.

Small changes are required to accomodate these changes to 5.4, as it
changes slightly the way of handling the modules.