CoolComputing Logo
Coupons/Deals  ·  New Promo Codes/Coupons  · October 23, 2017

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 [] [read 5178 times]

 
PHP Tips and Code Examples
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):


  1. download the source rpm for PHP, usually it'll have the word "src" in the file name

  2. install it - e.g. "rpm -Uvh php_src.rpm"

  3. edit the php.spec file, usually located at /usr/src/redhat/SPECS/php.spec, and add "--enable-dbase"




  4. run rpmbuild - e.g.: "rpmbuild -ba php.spec"

  5. Go to the directory of the newly created RPMs (e.g. /usr/src/redhat/RPMS/i386/) and install them (note the --force):


    rpm -Uvh --force php-4.3.8-1.1.i386.rpm php-devel-4.3.8-1.1.i386.rpm php-imap-4.3.8-1.1.i386.rpm php-ldap-4.3.8-1.1.i386.rpm php-mysql-4.3.8-1.1.i386.rpm php-pgsql-4.3.8-1.1.i386.rpm php-odbc-4.3.8-1.1.i386.rpm php-snmp-4.3.8-1.1.i386.rpm php-domxml-4.3.8-1.1.i386.rpm php-xmlrpc-4.3.8-1.1.i386.rpm php-mbstring-4.3.8-1.1.i386.rpm php-debuginfo-4.3.8-1.1.i386.rpm



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!

Adding The DBF DBase (or Any Custom) Extension In Linux (Red Hat, CentOS, Or Fedora) Rating: 2.1/5 (19 votes cast)

Your Name:
I have read and agreed to the Review Posting Agreement.
Review Title:
Comment/Review: