Install mongodb extension on Mac M1

在 Mac M1 上安装 PHP 开发环境遇到的问题。

安装 mongodb 扩展:

pecl install mongodb

编译错误:

/opt/homebrew/Cellar/php/8.0.1_1/include/php/ext/pcre/php_pcre.h:23:10: fatal error: 'pcre2.h' file not found

解决方案:

ln -s /opt/homebrew/Cellar/pcre2/10.36/include/pcre2.h /opt/homebrew/Cellar/php/8.0.1_1/include/php/ext/pcre/pcre2.h

参考:

https://stackoverflow.com/questions/66496119/pecl-fails-installing-mongodb-driver-on-apple-silicon-m1

 56 total views

四月读书计划

1.志摩的诗,徐志摩,天津人民出版社,2016

2.你是人间四月天,林徽因,浙江文艺出版社,2017

 44 total views