xdebug - 在 Apple Silicon M1 下安装/重建 Xdebug 时出现问题
问题描述
无法在 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,结果相同。我可以config.m4
在重新编译 xdebug 时强制使用正确的架构吗?- 还有其他建议吗?
解决方案
我需要指定架构。它适用于:
arch -arm64 sudo pecl install xdebug
推荐阅读
- javascript - 使用 document.write 异步运行外部 JS 函数
- python - 输入 0 与层 conv2d_11 不兼容:预期 ndim=4,发现 ndim=3 (Keras)
- c - macOS 10.12 中 C 语言的位右移与 Ubuntu 16.04 不同
- chatbot - 获取设备播放信息
- python - 使用 Python 更改另一个正在运行的进程的图标
- javascript - 将 select2 下拉列表从单选转换为多选
- python - 如何通过依赖于外部模型查询的模型属性对 Django Tables2 列进行排序
- c# - 如何在 asp.net 4.5 和 asp.net core 之间共享加密的 cookie?
- javascript - JavaScriptHTML iFrame 变量访问
- excel - 基于多 (3) 列合并 excel 工作表