php 如何解决 Windows 中的“调用未定义函数 dbase_open()”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22344867/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:50:57  来源:igfitidea点击:

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

phpmysqlxamppgmpdbf

提问by chaitra

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

嗨,我想将 DBF 文件加载到 mysql,我使用的是 xampp、php 版本 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

致命错误:在第 47 行调用 C:\xampp\htdocs\imports\import_geo.php 中未定义的函数 dbase_open()

$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.dllin php.ini, but in my php.ini extension=php_gmp.dllis not available, please help me.

我在一篇文章中看到,我们必须extension=php_gmp.dll在 php.ini 中取消注释,但在我的 php.ini extension=php_gmp.dll中不可用,请帮助我。

Thanks in advance

提前致谢

回答by

dBase is moved to PECL for now

dBase 暂时转移到 PECL

yum install php-pear
pecl install dbase

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

成功执行后,您需要在 php.ini 中添加“extension=dbase.so”

Or create dbase.iniin /etc/php.d with

或者在 /etc/php.d 中创建dbase.ini

extension=dbase.so

fliber.netuses this

fliber.net使用这个

回答by h0nza

How to on Ubuntu (15.04):

如何在 Ubuntu (15.04) 上:

1) install php5-dev

1)安装php5-dev

sudo apt-get install php5-dev

2) install dbase via pecl

2)通过pecl安装dbase

sudo pecl install dbase

3) load extension

3) 负载扩展

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

3.1)使用以下内容dbase.ini/etc/php5/mods-available/目录中创建文件:

extension=dbase.so

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

3.2) 在/etc/php5/apache2/conf.d/目录中创建符号链接:

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

4) restart apache

4)重启apache

回答by Evgeny

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.

您需要检查 PHP 目录中是否启用了 php_gmp.dll 文件,如果启用,则在 php.ini 中的扩展部分中添加此字符串“extension=php_gmp.dll”。

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

如果文件不存在,则将其添加到 apache 中的 php - 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=urlIt have many PHP versions, mySQL, PostgresQL, MongoDB, memcache, administration tools, regular updates, english support in forum and free!

可能是开放服务器会​​更好 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有很多PHP版本,mySQL,PostgresQL,MongoDB,memcache,管理工具,定期更新,论坛英文支持,免费!

回答by Karthick Kumar

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

检查您的xampp/php/ext文件夹php_gmp.dll,如果有扩展名,请将其添加extension=php_gmp.dll到 php.ini 文件中xampp/php/php.ini。否则将此dll添加到xampp/php/ext并执行上述步骤重新启动您的apache服务器