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

匿名 (未验证) 提交于 2019-12-03 02:03:01

问题:

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

回答1:

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



回答2:

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



回答3:

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!



回答4:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!