Results 1 to 8 of 8

Thread: [SOLVED] dbase support for php

  1. #1
    Join Date
    May 2008

    [SOLVED] dbase support for php

    I am running a LAMP ubuntu server and I need to be able to read from a .dbf file. This can be done by installing the dbase extension into php. I currently have php 5.1.2 and have tried everything I can think of to enable dbase.

    I have tried running ./configure --enable-dbase

    I have copy/pasted the into my extension library

    I have modified the php.ini file to read the extension

    And I have made sure that I am modifing the correct directories by looking at phpinfo()

    And I still get " Fatal error: Call to undefined function dbase_open() " when I try to open a .dbf file.

    Any suggestions?

    I'm wondering if I can just get the dbase class source code and just copy/paste into my .php file to "hardcode include" it. (if that makes sense)

  2. #2
    Join Date
    Jan 2007
    Melbourne, Australia

    Re: dbase support for php

    Maybe this will be of use.
    Ubuntu Newbie Help: irc: #beginners-help on network
    Help others, mark your threads solved.

  3. #3
    Join Date
    May 2008

    Re: dbase support for php

    Thank you! I have spent way too much time trying to figure this out. Problem is solved.

  4. #4
    Join Date
    Oct 2005
    Ubuntu 8.04 Hardy Heron

    Re: [SOLVED] dbase support for php

    Hi all,

    As I haven't the possibillty to re-compile PHP, I had to use another way to be able to use the dbase extension.

    Here is the procedure:

    1. Idendify what you need:
    root@gandalf:~# dpkg --status php5-common | egrep '^(Version)|(Architecture)'
    Architecture: amd64
    Version: 5.2.4-2ubuntu5.3
    2. Fetch a package which match your system:
    - I have use the site
    - Select "Go directly to the RPM database" and "Search"
    - Enter "php5-dbase" and go...
    - From the list, select a package as close as possible of your system (for me: "php5-dbase-5.2.4-10.x86_64.rpm").
    - Download the package.
    - Copy it in a temporary place (like "/tmp").

    3. As it's an "rpm" package, you need Alien in order to use it. Install Alien with:
    root@gandalf:~# apt-get install alien
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done

    ... bla bla bla ...

    Setting up rpm ( ...

    Setting up alien (8.69) ...
    Processing triggers for libc6 ...
    ldconfig deferred processing now taking place
    4. Now you need to open the rpm to get the files you need:
    root@gandalf:/tmp# alien -s php5-dbase-5.2.4-10.x86_64.rpm
    Directory php5-dbase-5.2.4 prepared.
    5. Check that the files you need are present:
    root@gandalf:/tmp# find . -name 'dbase.*'
    5. Check that the library is able to run:
    root@gandalf:/tmp# ldd ./php5-dbase-5.2.4/usr/lib64/php5/extensions/ => (0x00007fff40dfe000) => /lib/ (0x00007f1c3884c000)
    /lib64/ (0x00007f1c38dbe000)
    6. Now copy the files at the right place:
    root@gandalf:/tmp# cp -p ./php5-dbase-5.2.4/usr/lib64/php5/extensions/ /usr/lib64/php5/20060613/
    root@gandalf:/tmp# cp -p ./php5-dbase-5.2.4/etc/php5/conf.d/dbase.ini /etc/php5/conf.d/
    7. You need to restart the apache server to activate the new module:
    root@gandalf:/tmp# /etc/init.d/apache2 restart
    * Restarting web server apache2 [ OK ]
    8. Finally, check that the server is happy:
    root@gandalf:/tmp# tail /var/log/apache2/error.log
    [Mon Aug 25 11:08:01 2008] [info] removed PID file /var/run/ (pid=29440)
    [Mon Aug 25 11:08:01 2008] [notice] caught SIGWINCH, shutting down gracefully
    [Mon Aug 25 11:08:12 2008] [notice] Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch configured -- resuming normal operations
    [Mon Aug 25 11:08:12 2008] [info] Server built: Jun 25 2008 13:54:43
    9. Now you should be able to use the dbase extension...

    Good luck, Jacques-D.

  5. #5
    Join Date
    Oct 2005

    Re: [SOLVED] dbase support for php

    I've submitted a blueprint to try and get .dbf capabilities out of the box. If you're interested in getting this implemented please subscribe to the blueprint:

  6. #6
    Join Date
    Sep 2007
    Sofia, Bulgaria
    Ubuntu 10.04 Lucid Lynx

    Smile Re: [SOLVED] dbase support for php
    This is a very helpful article on the subject, note that you need to download PHP 5.2.13 from, since there isn't dbase included in the newer sources.
    When compiling dBase from the older source I've received error about duplicate "STATIC" on lines from 758 to 821. Remove the "static" statement and recompile, it works like a charm
    Linux user 467071
    Debian on alix 3d3

  7. #7
    Join Date
    Mar 2013

    Re: [SOLVED] dbase support for php

    Wanted to throw in a faster way to install dbase, without rebuilding php from source.

    1. Install PECL

    2. Install dbase package using PECL
    > sudo pecl install dbase

    3. Add "" to your php.ini file

  8. #8
    Join Date
    Feb 2007
    Ubuntu 16.04 Xenial Xerus

    Re: [SOLVED] dbase support for php

    From the Ubuntu Forums Code of Conduct.
    If a post is older than a year or so and hasn't had a new reply in that time, instead of replying to it, create a new thread. In the software world, a lot can change in a very short time, and doing things this way makes it more likely that you will find the best information. You may link to the original discussion in the new thread if you think it may be helpful.
    Thread closed.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts