xdebug 产生路径
/usr/local/Cellar/php/8.1.7/pecl/20210902/xdebug.so
xdebug编译
https://github.com/xdebug/xdebug
https://pecl.php.net/package/xdebug
https://xdebug.org/files/xdebug-3.1.5.tgz
tar -xzvf xdebug-3.1.5.tgz
cd xdebug-3.1.5
phpize
./configure --enable-xdebug
编译xdebug失败
configure: error: C compiler cannot create executables
error : cc -V
brew gcc修改
brew install gcc
查看gcc 路径
/usr/local/Cellar/gcc
.bash_profile修改,添加一下
alias gcc='gcc-11'
alias cc='gcc-11'
alias g++='g++-11'
alias c++='c++-11'
**error : ld: library not found for system **
.zshrc
export LIBRARY_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
最后编译、安装
./configure --with-php-config=/usr/local/Cellar/php/8.1.7/bin/php-config
make
make install
使用xdebug.so
image.png在终端 给php动态库签名
sudo codesign --sign "phpCA" --force --keychain /Users/name/Library/Keychains/login-keychain-db /usr/local/Cellar/php/8.1.17/lib/httpd/modules/libphp.so
配置/usr/local/etc/php/8.1/php.ini
[xdebug]
zend_extension="/usr/local/Cellar/php/8.1.7/pecl/20210902/xdebug.so"
xdebug.mode = debug
xdebug.start_with_request=yes
xdebug.client_host ="127.0.0.1"
xdebug.client_port =9010
# xdebug.client_host/xdebug.client_port
xdebug.collect_return=On
xdebug.idekey="XDEBUG_ECLIPSE"
xdebug.log="/Users/name/phplog/xdebug.log"
xdebug.mode = debug
xdebug.start_with_request=yes
xdebug.client_host ="127.0.0.1"
xdebug.client_port =9010
# xdebug.client_host/xdebug.client_port
xdebug.collect_return=On
xdebug.idekey="XDEBUG_ECLIPSE"
xdebug.log="/Users/name/phplog/xdebug.log"
网友评论