无法使用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");