Compiling PHP5 modules in Debian

14 01 2009

Hey!

This post explains my first attempts in getting PDO_OCI installed in Debian. Even though it works and has served me quite well for some time, now I’ve found a way to make actual .deb packages of these modules so I can save them for later use (or distribution, as long as their source code goes along) and have them installed in a sane way via the package manager.

So, first things first. You have to download php5 source (apt-get source php5) and its build dependencies (apt-get build-dep php5). Next thing is to build the extension you need.

I’ll take PDO for an example.

First, enter the extension’s directory:
cd php5-5.2.6.dfsg.1/ext/pdo
Now, look for a .xml file in this directory. In this case, it is called package2.xml. It contains the extension’s package description. Now, build a .tgz of the extension:
pecl package package2.xml
It will generate a PDO-1.0.3.tgz file. Now, create a Debian package source for this archive:
dh-make-pecl --only 5 PDO-1.0.3.tgz
The –only 5 parameter tells the script builder to make only the php5 package (not php4). Next step is to build the package:
cd php-pdo-1.0.3
fakeroot debian/rules binary

If all goes well, there’s a ../php5-pdo_1.0.3-1_i386.deb file, ready to be installed!

About these ads

Actions

Information

One response

31 03 2009
pdo_oci the Debian way (almost) « . cassiano leal .

[...] the Debian way (almost) 31 03 2009 Following up to this post and this post, here’s quick instructions on how to actually get the proper pdo_oci package on Debian [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: