Read table .dbf from PHP


I have several days struggling with this, I need to migrate a table of .dbf to MySQL for which I try to open it with the next one caught and then go through it but it throws me an error,

$db = dbase_open("INARTICULOS.DBF", 0);

    $numero_registros = dbase_numrecords($db);
    for($i = 1; $i <= $numero_registros; $i++){
        $fila = dbase_get_record_with_names($db, $i);

        echo $fila["RAZSOC"];

Error: * Fatal error: Call to undefined function dbase_open () in   /Applications/XAMPP/xamppfiles/htdocs/DBFtoMysql/index.php on line 5 *

I need to activate the dbase extension, but in the file php.ini is not, and tried from my Mac and from Windows help please.

asked by MIGUEL LOPEZ 05.04.2016 в 17:11

2 answers


It is necessary to check in the PHP file directory (xampp / php / ext) that php_gmp.dll exists and enable it if it exists, then in the php.ini it adds this string


extension = php_gmp.dll

in the extensions section.

If the file does not exist, download it, then add it to PHP - link

Solution taken from OS in English: link

answered by 05.04.2016 в 17:38

Some time ago I had an equal problem when I enabled some extensions in the php.ini file and adding the dlls in the ext folder and I still followed the error. I solved it by downloading another version of xampp and verifying that it contains the dll then I enabled it in php.ini and that way I solved my problem it's a bit confusing but it worked for me

answered by 05.04.2016 в 21:10