微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法使用PHP 7.3安装RAR扩展

如何解决无法使用PHP 7.3安装RAR扩展

我正在尝试安装rar软件包。我检查了PHP.net的安装文档,它只是说要执行pecl -v install rar

/tmp/pear/temp/rar/rararch.c:34: note: this is the location of the prevIoUs deFinition
 #define _GNU_SOURCE

/tmp/pear/temp/rar/rararch.c: In function ‘rararch_it_get_iterator’:
/tmp/pear/temp/rar/rararch.c:961:25: error: ‘zend_class_entry’ {aka ‘struct _zend_class_entry’} has no member named ‘iterator_funcs’; did you mean ‘iterator_funcs_ptr’?
  it->parent.funcs = ce->iterator_funcs.funcs;
                         ^~~~~~~~~~~~~~
                         iterator_funcs_ptr
/tmp/pear/temp/rar/rararch.c: In function ‘minit_rararch’:
/tmp/pear/temp/rar/rararch.c:1173:18: error: ‘zend_class_entry’ {aka ‘struct _zend_class_entry’} has no member named ‘iterator_funcs’; did you mean ‘iterator_funcs_ptr’?
  rararch_ce_ptr->iterator_funcs.funcs = &rararch_it_funcs;
                  ^~~~~~~~~~~~~~
                  iterator_funcs_ptr
make: *** [Makefile:198: rararch.lo] Error 1
rolling back 441 file operations
ERROR: `make' Failed

如何在debian 10上用PHP 7.3安装rar扩展?

解决方法

引用https://www.php.net/rar的评论

正式地,它仅支持php 5.3至7.1。幸运的是,它适用于某些7.2版本。 rar pecl-site上的错误报告多年没有被修改。 我认为应该删除php.net上的此文档,rar支持已失效

执行此操作的其他方法:

shell_exec("unrar x $pathToRar $dirToExtractTo"); 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。