Are you getting an undefined function when you use dbase_create? Are you getting nothing at all? Well, probably you don’t have the dbase extension enable.
First, check for dbase.so. Try to search in your system and may be you have some luck and you have it, but it’s not enabled. Check the last part of this post to find out how to enable it.
So, two possible solutions exist for this problem: Either you compile PHP from scratch, or you compile just the dbase extension.
For compiling the complete php5 package, refer to this excellent post: http://linuxhints.blogspot.com/2006/06/i-needed-to-have-php-compiled-with.html
In my case, I just wanted to compile the extension. However, I found out I couldn’t do that because the extension is not included in my php installation. I’m extending Mark Sanborn’s post, adding a solution for the non existing dbase extension.
I found out that since php 5.3.x the dbase extension was removed because it now not actively developed.
Because of that php team’s decision, now you have to download directly from reporsitory. So, I update the instructions:
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.
1) root@zenware:/# sudo su
and type your password
2) apt-get install shtool dpkg-dev subversion
3) cd /opt
4) mkdir php
5) cd /opt/php
6) apt-get source php5
As I told you, also DBase extension is no longer included, so:
7) cd /opt/php/php5-5.3.2/ext/
9) svn co http://svn.php.net/repository/pecl/dbase/trunk dbase
10) cd /opt/php/php5-5.3.2/ext/dbase
14) cp cp /opt/php/php5-5.3.2/ext/dbase/modules/dbase.so /usr/lib/php5/20090626+lfs/.
15) /etc/init.d/apache2 restart
Done! Have a nice day.