0

我想在我的本地环境中安装 Xdebug,我遵循了 Xdebug 向导,但是通过命令安装后,php -v我收到了来自上面的警告。

我试过安装arch -x86_64 sudo pecl install xdebug,不工作。

which php->/Applications/XAMPP/xamppfiles/bin/php

php -v->

PHP Warning:  Failed loading Zend extension 'xdebug'
   (tried: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug, 0x0009):
    tried: '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug' (no such file),
           '/usr/local/lib/xdebug' (no such file),
           '/usr/lib/xdebug' (no such file)),
           /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so, 0x0009):
    tried: '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')),
           '/usr/local/lib/xdebug.so' (no such file),
           '/usr/lib/xdebug.so' (no such file))
   ) in Unknown on line 0
 
Warning: Failed loading Zend extension 'xdebug' (tried: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug, 0x0009): tried: '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug' (no such file), '/usr/local/lib/xdebug' (no such file), '/usr/lib/xdebug' (no such file)), /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so (dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so, 0x0009): tried: '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/xdebug.so' (no such file), '/usr/lib/xdebug.so' (no such file))) in Unknown on line 0
PHP 7.4.26 (cli) (built: Nov 22 2021 01:21:25) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies

php.ini

zend_extension=opcache.so
zend_extension=xdebug

任何想法?

4

0 回答 0