php7.1以上版本安装ds拓展

使用pecl安装

报错

/opt/homebrew/Cellar/php@7.4/7.4.26_1/include/php/ext/pcre/php_pcre.h:25:10: fatal error: 'pcre2.h' file not found

解决办法

ln -s /opt/homebrew/include/pcre2.h /opt/homebrew/Cellar/php@7.4/7.4.26_1/include/php/ext/pcre/pcre2.h

在对应的报错目录下添加需要使用的文件即可

DS拓展使用官方文档

https://www.php.net/manual/zh/class.ds-collection.php