其他分享
首页 > 其他分享> > Mac m1 安装 swoole

Mac m1 安装 swoole

作者:互联网

下载 swoole最新版


https://pecl.php.net/package/swoole

sudo /opt/homebrew/Cellar/php@7.3/7.3.32/bin/phpize

sudo ./configure --with-php-config=/opt/homebrew/Cellar/php@7.3/7.3.32/bin/php-config

sudo make

遇到问题

'pcre2.h' file not found


ln -s /opt/homebrew/include/pcre2.h /opt/homebrew/Cellar/php@7.3/7.3.32/include/php/ext/pcre/pcre2.h

再次sudo make

又报错

linker command failed with exit code 1 (use -v to see invocation)

降低swoole版本到 4.8.3

sudo make install

sudo make test

修改php.ini


sudo vim /opt/homebrew/etc/php/7.3/php.ini 

添加

extension=swoole.so

重启php


 brew services restart php@7.3

查看phpinfo

标签:opt,swoole,sudo,7.3,Mac,m1,homebrew,php
来源: https://www.cnblogs.com/jiqing9006/p/16134570.html