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


Was this information useful?


15 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.

  5. alek on December 22nd, 2008

    Thanks, its works!

  6. TheD on January 29th, 2009

    Worked on the first try – You’re test best and saved my day! Thank you very much!

  7. Mister.Rusty on March 19th, 2009

    Thanks – consise and accurate. Worked first time.

  8. macjohn on April 14th, 2009

    Thank you. You saved me a headache.

  9. Putin Andrey on June 7th, 2009

    In PHP 5.2.6 (Ubuntu 9.04 server) dbase module seems to be purged from source.
    And I don’t how dbase support can be installed..

  10. Putin Andrey on June 7th, 2009

    //update: need to download php from php.net, the ext/dbase is in it.

  11. Arie on July 1st, 2009

    Wok like a charm.. ! Thanks ! :-)

  12. Matt Kendricks on July 9th, 2009

    Works great!

  13. Andry Rakotomanjaka on August 5th, 2009

    That works for me ! thank you very much.

  14. Chris on August 14th, 2009

    The dbase extension isn’t included in php 5.2.10, but you can download the latest source here http://www.php.net/downloads.php

    Then perform the same instructions and all will be well. I am actually running 5.2.6, but I had no problem using the dbase.so library compiled using the 5.2.10 source.

    Thanks so much for taking the time to post this very helpful article.

  15. amine on October 23rd, 2009

    at the end of processus;

    add :
    /etc/init.d/apache2 reload