【发布时间】:2021-03-11 04:38:38
【问题描述】:
无法在 Big Sur 下的新 Apple Silicon M1 下安装 XDebug - 使用 pecl install xdebug 并运行 php --ini 后出现以下错误:
PHP Warning: Failed loading Zend extension 'xdebug.so' (tried: /opt/homebrew/lib/php/pecl/20190902/xdebug.so (dlopen(/opt/homebrew/lib/php/pecl/20190902/xdebug.so, 9): no suitable image found. Did find:
/opt/homebrew/lib/php/pecl/20190902/xdebug.so: mach-o, but wrong architecture
/opt/homebrew/lib/php/pecl/20190902/xdebug.so: stat() failed with errno=22), /opt/homebrew/lib/php/pecl/20190902/xdebug.so.so (dlopen(/opt/homebrew/lib/php/pecl/20190902/xdebug.so.so, 9): image not found)) in Unknown on line 0
Warning: Failed loading Zend extension 'xdebug.so' (tried: /opt/homebrew/lib/php/pecl/20190902/xdebug.so (dlopen(/opt/homebrew/lib/php/pecl/20190902/xdebug.so, 9): no suitable image found. Did find:
/opt/homebrew/lib/php/pecl/20190902/xdebug.so: mach-o, but wrong architecture
/opt/homebrew/lib/php/pecl/20190902/xdebug.so: stat() failed with errno=22), /opt/homebrew/lib/php/pecl/20190902/xdebug.so.so (dlopen(/opt/homebrew/lib/php/pecl/20190902/xdebug.so.so, 9): image not found)) in Unknown on line 0
我尝试从源代码 (git clone git://github.com/xdebug/xdebug.git) 重新编译 xdebug,结果相同。重新编译 xdebug 时,我可以在 config.m4 中强制使用正确的架构吗? - 还有其他建议吗?
【问题讨论】:
-
我在做 phpize 之前尝试过这个:./configure --enable-xdebug CC="gcc -arch x86_64" CXX="g++ -arch x86_64" 但现在我得到了:“代码签名在( /usr/local/lib/php/pecl/20200930/xdebug.so)在使用库验证的进程中无效:映射文件没有 cdhash,完全未签名?代码必须至少是临时签名的“
标签: xdebug apple-silicon