Skip to content
Go back

安装swoole

Published:  at  08:00 AM

准备材料

$ phpize

$ ./configure

$ sudo make && sudo make install
$ php -i | grep php.ini

Configuration File (php.ini) Path => /opt/homebrew/etc/php/8.3
Loaded Configuration File => /opt/homebrew/etc/php/8.3/php.ini
$ php --ri swoole
swoole

Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 6.0.0
Built => Sep 30 2024 15:10:53
coroutine => enabled with boost asm context
kqueue => enabled
rwlock => enabled
http2 => enabled
json => enabled
pcre => enabled
zlib => 1.2.12
brotli => E16781312/D16781312

Directive => Local Value => Master Value
swoole.enable_library => On => On
swoole.enable_fiber_mock => Off => Off
swoole.enable_preemptive_scheduler => Off => Off
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 262144 => 262144

遇到的问题

/opt/homebrew/Cellar/php/8.3.8/include/php/ext/pcre/php_pcre. h:23:10: fatal error: ‘pcre 2. h’ file not found

本质是系统缺少 pcre 2 库或者 pcre 2. h 头文件没有被正确地链接到 PHP 的安装目录

brew install pcre2
ln -s /opt/homebrew/Cellar/pcre2/10.44/include/pcre2.h /opt/homebrew/Cellar/php/8.3.8/include/php/ext/pcre/pcre2.h

Share this post on:

Previous Post
软件使用记录
Next Post
保健品相关知识