请问boss,dbase如何启用?我需要读取dbf在服务器环境下

问答中心分类: Database请问boss,dbase如何启用?我需要读取dbf在服务器环境下
匿名用户 asked 9 年 ago
请问boss,dbase如何启用?我需要读取dbf在服务器环境下

9 Answers
cnyyk answered 9 年 ago
--enable-dbase,无法识别
 
pecl install dbase
提示无法编译成功
 
求教,急用

oneinstack answered 9 年 ago
wget http://pecl.php.net/get/dbase-5.1.0.tgz
tar xzf dbase-5.1.0
cd dbase-5.1.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
cd /usr/local/php/lib/php/extensions
ls  #看到no-debug-non-zts-20131226类似文件夹
cd no-debug-non-zts-20131226
ls  #查看有没有 dbase.so
vi /usr/local/php/etc/php.ini
找到extension = "imagick.so"类似,下面添加一行
extension = "dbase.so

cnyyk answered 9 年 ago
thanks for reply.

cnyyk answered 9 年 ago
还是不行咯。
和pecl install dbase一样的提示:
make: *** [dbase.lo] Error 1
ERROR: `make' failed
 
系统是
Linux iZ23zctjmkaZ 3.10.0-327.3.1.el7.x86_64 #1 SMP Wed Dec 9 14:09:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.2.1511 (Core)
PHP是7.0.2

cnyyk answered 9 年 ago
错误从这里开始:
/root/dbase-5.1.0/dbase.c:856:6: warning: assignment makes pointer from integer without a cast [enabled by default]
  dbh = zend_list_find(Z_LVAL_PP(dbh_id), &dbh_type);
      ^
/root/dbase-5.1.0/dbase.c:872:51: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
   add_assoc_string(row, "name", cur_f->db_fname, 1);
                                                   ^
/root/dbase-5.1.0/dbase.c:872:3: error: 'add_assoc_string' undeclared (first use in this function)
   add_assoc_string(row, "name", cur_f->db_fname, 1);

cnyyk answered 9 年 ago
/tmp/pear/temp/dbase/dbase.c:856: warning: assignment makes pointer from integer without a cast
/tmp/pear/temp/dbase/dbase.c:872:51: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:872: error: 'add_assoc_string' undeclared (first use in this function)
/tmp/pear/temp/dbase/dbase.c:876:58: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:877:53: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:878:56: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:879:55: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:880:56: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:881:53: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:882:54: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:883:56: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
/tmp/pear/temp/dbase/dbase.c:900:54: error: macro "add_assoc_string" passed 4 arguments, but takes just 3
make: *** [dbase.lo] Error 1
ERROR: `make' failed

oneinstack answered 9 年 ago
下载dbase php7 的组件,不知道有更新没。。上面只是方法

cnyyk answered 9 年 ago
谢谢。回复。没有。最后一次就是5.1.0,2012年更新的。

看官方文档,默认支持的?
http://php.net/manual/en/function.dbase-open.php
(PHP 4, PHP 5, PHP 7)
dbase_openOpens a database 

cnyyk answered 9 年 ago
还是无解。无法使用php原生扩展,这种性能肯定有雨第三方的实现。
 
无奈之下只能用这个了:
https://github.com/hisamu/php-xbase