Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k views
in Technique[技术] by (71.8m points)

php - How to solve "Call to undefined function dbase_open() " error in windows

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:xampphtdocsimportsimport_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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...