5

Hi i want to load DBF file to mysql, am using xampp,php version 5.5.6

i had write the below code,

But am getting Error ---

Fatal error: Call to undefined function dbase_open() in C:\xampp\htdocs\imports\import_geo.php on line 47

$dbf = dbase_open('OUTLETS/regions.dbf', 0);
$num_records = dbase_numrecords($dbf);
for($i=1;$i<=$num_records;$i++)
{
    $record = dbase_get_record_with_names($dbf, $i);
    $stmt_bricks->execute(array(
        ':id' => $next_brick_id,
        ':type' => 'Region',
        ':code' => $record['REG_CODE'],
        ':descr' => $record['REG_DESC'],
    ));
    $regions_code_to_id[$record['REG_CODE']] = $next_brick_id++;
}

I saw in one article, we have to uncomment extension=php_gmp.dll in php.ini, but in my php.ini extension=php_gmp.dll is not available, please help me.

Thanks in advance

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
chaitra
  • 83
  • 1
  • 2
  • 9
  • 2
    You have to _install_ the extension, then enable it. Typical distributions pack that extension with php, seems not to be the case with the one you use... You can check if it is available inside the output of a testwise `` you run. – arkascha Mar 12 '14 at 07:43
  • `dbase_open` is part of the dBase extension. What makes you think that you need to enable GMP for this? – Nico Haase Jul 22 '21 at 08:36

5 Answers5

5

dBase is moved to PECL for now

yum install php-pear
pecl install dbase

After successful execution, you'll need to add "extension=dbase.so" to your php.ini

Or create dbase.ini in /etc/php.d with

extension=dbase.so

fliber.net uses this

4

How to on Ubuntu (15.04):

1) install php5-dev

sudo apt-get install php5-dev

2) install dbase via pecl

sudo pecl install dbase

3) load extension

3.1) create dbase.ini file in /etc/php5/mods-available/ directory with this content:

extension=dbase.so

3.2) create sym link in /etc/php5/apache2/conf.d/ directory:

sudo ln -s ../../mods-available/dbase.ini 20-dbase.ini

4) restart apache

h0nza
  • 56
  • 3
0

Check is there dbase extension(php_dbase.dll) is there in 'C:\xampp\php\ext'. if dll file there then check is it enabled or not in php.ini file. if not enabled follow from step 3.

if it's not there then follow below steps.

  1. download (refer below link) php_dbase.dll file according to your system and php version.

    Link - https://pecl.php.net/package/dbase

  2. add downloaded 'php_dbase.dll' file to in 'C:\xampp\php\ext'

  3. open php.ini file

  4. search 'extension=', you will find many extension there.

  5. add below line after all extension list. 'extension=php_dbase.dll' (without quote)(no issue if add this line at the end of file.

Restart apache server. it will start working in local - windows system.

Note:- update file name with 'php_dbase.dll' if file name is different.

  • What's the reason to link to a repository that hasn't seen any updates since two years, and which also links to another page in bold letters? – Nico Haase Jul 22 '21 at 08:37
  • i tried multiple solution for 3 days, not a single worked, then i found this solution, that's why added this answer. there is no other repository, for php dbase, where i found dbase extension. – alish vagadiya Jul 22 '21 at 12:45
  • Why not use the official builds from https://pecl.php.net/package/dbase? – Nico Haase Jul 22 '21 at 12:49
  • thanks for sharing link, i checked, it contain latest dll file. we should using https://pecl.php.net/package/dbase and dowlnload dll file according to php version. – alish vagadiya Jul 23 '21 at 06:35
-1

You need to check in PHP directory is file php_gmp.dll enable and if it does, then in php.ini add this string "extension=php_gmp.dll" in extensions section.

If file does not exist then add it to php in apache - http://www.dll4free.com/php_gmp.dll.html

May be Open server will be better them XAMPP - http://translate.google.ru/translate?sl=ru&tl=en&js=n&prev=_t&hl=ru&ie=UTF-8&u=http%3A%2F%2Fopen-server.ru%2Fdownload.html&act=url It have many PHP versions, mySQL, PostgresQL, MongoDB, memcache, administration tools, regular updates, english support in forum and free!

Evgeny
  • 102
  • 5
  • i did the above step, but Am getting error “the procedure entry point php_checkuil could not be located in the dynamic link libarary php5ts.dll” & PHP startup: unable to load dynamic libarary 'C\xampp\ext\php_dbase.dll, The specified procedure could not be founded. – chaitra Mar 12 '14 at 09:41
  • Why should enabling the GMP extension help when `dbase_open` is not found? – Nico Haase Jul 23 '21 at 09:15
-2

check in your xampp/php/ext folder for php_gmp.dll ,if the extension is there add this extension=php_gmp.dll to php.ini file in xampp/php/php.ini. else add this dll to xampp/php/ext and do the above step restart your apache server

Karthick Kumar
  • 2,349
  • 1
  • 17
  • 30