PHP-使用XAMPP(UNIX文件)在Mac上安装XDEBUG

发布于 2025-01-28 15:13:53 字数 1049 浏览 4 评论 0原文

我在我的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..

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲世九天 2025-02-04 15:13:53

最终解决了它,对于每个遇到相同问题的人:

在M1上,您的PHP可以用于X86_64或ARM64架构。 PECL工具无法猜测它是哪一个,因此,如果您的PHP用X86_64和默认编译器设置为ARM64,则您会收到上述警告。
这意味着,有时您必须使用:

arch -x86_64 sudo pecl install xdebug

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:

arch -x86_64 sudo pecl install xdebug

The arch -x86_64 part will set up the environment to compile Xdebug as x86_64 binary.

Thank you all for suppоrt!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文