Adding the DBF dBase (or Any Custom) Extension in Linux (Red Hat, CentOS, or Fedora)
Posted on Saturday, November 29, 2014 @ 02:58:36 PM CST by David Yee [profile] [read 5285 times]
The previous article explained how to convert and import data from DBF files into MySQL. It is actually simple enough to enable the dBase extension for PHP for Windows by just by uncommenting out a line in php.ini, but if you are using Red Hat/CenOS/Fedora, this is not as simple.
There is no RPM file that you can simply install to enable the dBase extension, so you have to recompile and build the PHP Linux RPM. Here are the steps to do this (note that this can work with other extensions that you can't find the rpm for):
download the source rpm for PHP, usually it'll have the word "src" in the file name
install it - e.g. "rpm -Uvh php_src.rpm"
edit the php.spec file, usually located at /usr/src/redhat/SPECS/php.spec, and add "--enable-dbase"
run rpmbuild - e.g.: "rpmbuild -ba php.spec"
Go to the directory of the newly created RPMs (e.g. /usr/src/redhat/RPMS/i386/) and install them (note the --force):
That should get the job done. Even though this example uses the older PHP 4, you can easily substitute in the appropriate new PHP 5.x versions.
Please rate this article or post a brief review of Adding the DBF dBase (or Any Custom) Extension in Linux (Red Hat, CentOS, or Fedora) or comment on benchmark/performance, features, availability, price or anything else regarding Adding the DBF dBase (or Any Custom) Extension in Linux (Red Hat, CentOS, or Fedora). Thanks!