Getting Ubuntu 14.04 php5enmod to understand module priority

Usage of Debian’s php5enmod module doesn’t seem to be documented anywhere except from the command line when calling it without any arguments:

user@host:~# php5enmod
usage: php5enmod [ -s ALL|sapi_name ] module_name [ module_name_2 ]

Unfortunately, that provides no information on how to customize the priority of a module when enabling it. Some others seem to think that you should be able to provide a priority level on the command line, but that doesn’t work.

It took some digging into the bash scripts to figure out how to make it work. The trick is to add a comment in the .ini file for the module. The comment must contain a very specific format of:

zend_extension = /usr/lib/php5/20121212/
; priority=1

The ‘priority’ line must be in that format exactly and most not contain any other spaces or characters. The line must start with a semicolon, followed by a space, followed by priority=, and finally the desired priority level. The only space on the line must be between the semicolon and the word ‘priority’.

2 thoughts on “Getting Ubuntu 14.04 php5enmod to understand module priority”

  1. Thanks for this, I looked at some of the existing extensions to try to figure this out and assumed the priority line was a comment like the line above it.

  2. Note that to be consistent with the other extensions and display in the correct order in the terminal your Ioncube example should be ; priority=01 instead of ; priority=1. I’m guessing this doesn’t have any affect on the real priority though.

Leave a Reply

Your email address will not be published. Required fields are marked *