Adding dbase Support to PHP5 on Ubuntu

For the popular packages Ubuntu has handy little packages that will install/add extentions to PHP, but not for dbase. Dbase is old as dirt and most people don’t use it for much anymore. I was recently working on a legacy app that works with dbase files and this was the extension i needed to allow php to work with the old dbase system.

After searching online for awhile I couldn’t really find a good answer for how to add the extension without completely reinstalling PHP5 from source.

What i ended up doing was just compiling that extenstion from source and pointing to it from my php.ini leaving my existing php5 intact.

Getting the source

 
First thing you will need to do install install the php5-dev package:

apt-get install php5-dev

This will give us the tools needed to work with the source code. Next grab the source. In your home directory…

mkdir php
cd php
apt-get source php5

Then go into the extension directory.

cd php5-5.1.2/ext/dbase

Compile the Extension

Once you are in the dbase directory do:

phpize

Then,

./configure

Followed by a,

make

Copy the extension

 
cp modules/* /usr/lib/php5/20051025/

Your php5 library directory might be named something else.

Edit php.ini

 
You will then need to edit the php.ini file

vim /etc/php5/apache2/php.ini

Near the extention section add:

extension=dbase.so




4 Responses to "Adding dbase Support to PHP5 on Ubuntu"
  1. Marc St-Jacques on August 18th, 2008

    Great tutorial. Worked like a charm.

    Don’t forget to add the same module
    to /etc/php5/cli/php.ini for those who use PHP on the command line.

  2. Orvalho J Augusto on August 22nd, 2008

    Greate!

    It worked for me too.

    Caveman

  3. Daniele Gariboldi on September 3rd, 2008

    Great ! Thanks, clear and effective

  4. DiseƱo y desarrollo web on October 22nd, 2008

    Brilliant man! You saved my head.

Leave a reply