1.装置命令

brew install phpbrew upgrade php
扩大应首先尝试 pecl install xx 装置。

不通过时的状况:如:swoole、uuid,上面为踩坑教训。

2.fatal error: 'php.h' file not found

百度计划: brew doctor && brew link --overwrite php
【修复零碎链接】,依然有问题。

上面是sdebug装置实例:

git clone git@github.com:swoole/sdebug.git -b sdebug_2_9 --depth=1cd sdebugphpize./configuremake cleanmakemake install
查找 php.h 等,缺啥加上就行
cp -r /usr/local/include/php/ sdebugmake find . -name zend.hcp ./Zend/* .make find . -name TSRM.hcp ./TSRM/* .make

胜利,持续

make installll  /usr/local/Cellar/php/7.4.12/lib/php/20190902/

能够看到 xdebug.so 曾经好了,增加即可。

总体就是
cp -r /usr/local/include/php/ sdebug && cp ./Zend/* . && cp ./TSRM/* .

而后从新 make,增加到php.ini:

zend_extension=php_xdebug

调试《沈唁: Swoole 如何应用 Xdebug 进行单步调试》