User Tools

Site Tools


Sidebar

js#vista.png msort nsort

debian:build_php_extension_packages

Creating your own PHP Extensions Packages

Thanks Guillaume Plessis

Everyone Debian Admin knows about the Dotdeb packages. Well, Guillaume Plessis is the one to thank for that. He is also the one to thank for the easy method of packaging PHP extensions.

The "How" and the "To"

Packages

All you need is the “dh-make-php” package (which includes dh-make-pear and dh-make-pecl), the “build-essential” package and the PHP development package. Dependancies for the extensions are something you will need to figure out for yourselves though.

apt-get install dh-make-php php5-dev build-essential

Settings

You need to set the environment correctly or you will be needing to type a few options when executing. I prefer to set mine in “~/.bashrc” as follows:

export DEBFULLNAME="First Last"
export DEBEMAIL="user@domain.tld"

Make sure the entries look as above, including the “export”. If not the scripts will not work correctly. Also, make sure to put your name and mail address. ;)

The Sauce and the meat

Here's where it starts getting tasty. Now that everything is ready just download the extension you want to install.

pecl download apc-beta

As you can see I have just downloaded the beta APC extension (3.1.13 as of this writing). If you are wanting stable then just leave off the “-beta”.

Now all that is left is building the package itsself:

dh-make-pecl --only 5 APC-3.1.13.tgz
cd php-apc-3.1.13/
./debian/rules binary

Enjoy

debian/build_php_extension_packages.txt · Last modified: 2020/02/24 11:16 (external edit)