PHP-使用XAMPP(UNIX文件)在Mac上安装XDEBUG
我在我的PHP项目上安装 xdebug 。我在MacOS Monterey M1上,并且正在使用 XAMPP 在PHP版本7.4.28上启动项目。
我遵循其官方网页上给出的说明:
Download xdebug-3.1.4.tgz
Run: cd xdebug-3.1.4
Run: phpize (See the FAQ if you don't have phpize).
Run: ./configure
Run: make
Run: cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902
Update /Applications/XAMPP/xamppfiles/etc/php.ini and add the line:
zend_extension = xdebug
在我的终端中键入php -v
时,我首先会遇到几个错误,例如:
HP启动:无法加载动态库'php_soap.dll'(尝试: /applications/xampp/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/php_soap.dll
我尝试了遵循路径>而不是添加文件的文件夹。
我该如何绕过它?我知道XAMPP不是Mac的最佳解决方案,但我认为它已被其他人使用。
I have a trouble installing Xdebug on my PHP project. I am on macOS Monterey M1 and I am using XAMPP for launching project on PHP version 7.4.28.
I followed the instructions given on their official webpage:
Download xdebug-3.1.4.tgz
Run: cd xdebug-3.1.4
Run: phpize (See the FAQ if you don't have phpize).
Run: ./configure
Run: make
Run: cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902
Update /Applications/XAMPP/xamppfiles/etc/php.ini and add the line:
zend_extension = xdebug
When typing php -v
in my terminal I first get few errors like:
HP Startup: Unable to load dynamic library 'php_soap.dll' (tried:
/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20190902/php_soap.dll
I tried following the path and I saw that in the specific folder there is Unix Executable File and not the folder with added files..
How can I bypass this? I know XAMPP is not the best solution for Mac, but I see that it has been used by others.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终解决了它,对于每个遇到相同问题的人:
在M1上,您的PHP可以用于X86_64或ARM64架构。 PECL工具无法猜测它是哪一个,因此,如果您的PHP用X86_64和默认编译器设置为ARM64,则您会收到上述警告。
这意味着,有时您必须使用:
ARCH -X86_64零件将设置环境以将Xdebug编译为X86_64二进制。
谢谢大家支持!
Finally solved it and for everyone having the same issue:
On M1, your PHP can either be compiled for the x86_64 or arm64 architectures. The pecl tool can't guess which one it is, so if your PHP is compiled with say x86_64 and the default compiler setting is arm64, then you'll get the above warning.
This means, that sometimes you have to run PECL with:
The arch -x86_64 part will set up the environment to compile Xdebug as x86_64 binary.
Thank you all for suppоrt!