未能在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
中强制使用正确的体系结构吗?- ANy其他建议?
发布于 2021-05-27 19:30:38
我需要指定架构。它在以下情况下工作:
arch -arm64 sudo pecl install xdebug
发布于 2021-03-26 15:29:36
已尝试使用pecl install xdebug
进行安装,并收到以下错误:
Build process completed successfully
Installing '/opt/homebrew/Cellar/php@7.4/7.4.15_1/pecl/20190902/xdebug.so'
Warning: mkdir(): File exists in System.php on line 294
Warning: mkdir(): File exists in /opt/homebrew/Cellar/php@7.4/7.4.15_1/share/php@7.4/pear/System.php on line 294
ERROR: failed to mkdir /opt/homebrew/Cellar/php@7.4/7.4.15_1/pecl/20190902
我使用了这个链接https://patriqueouimet.ca/tip/installing-php-and-pecl-extensions-on-macos中的修复,它很有帮助
你的警告是关于架构的,可能需要重新删除并安装-我是从arm64终端完成所有操作的……
发布于 2021-04-12 18:21:36
您可能必须使用以下命令通过PECL安装Xdebug:
arch -x86_64 sudo pecl install xdebug
https://stackoverflow.com/questions/65053551
复制相似问题