在 Mac 上使用 XAMPP 安装 XDebug for PHP [英] Installing XDebug for PHP with XAMPP on Mac

查看:27
本文介绍了在 Mac 上使用 XAMPP 安装 XDebug for PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台安装了全新 OSX Mojave 的 Mac.我下载了 XAMPP (7.3) 并安装了.本地 Apache Web 服务器正常工作,我从仪表板获得的 PHPInfo() 显示了 php.ini 文件的所有正确信息,即/Applications/XAMPP/xamppfiles/etc/php.ini.

I have a Mac with a fresh OSX Mojave install. I downloaded XAMPP (7.3) and installed. The local Apache web server works and the PHPInfo() I get from the dashboard shows all the correct information for the php.ini file being the /Applications/XAMPP/xamppfiles/etc/php.ini.

我已经复制了 PHPInfo 并将其放入向导中:

I have taken a copy of the PHPInfo and put it in the wizard at:

https://xdebug.org/wizard.php

说明看起来很简单.我确实必须先使用自制软件来安装 autoconf.

The instructions look simple. I did have to use homebrew to install autoconf first.

但后来我能够在/Applications/XAMPP/xamppfiles/文件夹中下载并解压 xdebug-2.6.1.tgz.

But then I was able to download and unpack the xdebug-2.6.1.tgz in the /Applications/XAMPP/xamppfiles/ folder.

我更改了 $PATH 变量,使/Applications/XAMPP/xamppfiles/bin 成为搜索的第一个路径,以便运行正确的 phpize.

I changed my $PATH variable to have /Applications/XAMPP/xamppfiles/bin be the first path searched, so that the correct phpize would run.

我切换到/Applications/XAMPP/xamppfiles/xdebug-2.6.1 文件夹并运行 phpize,然后运行 ​​./configure.一切似乎都运行良好,没有发现任何错误.

I changed to the /Applications/XAMPP/xamppfiles/xdebug-2.6.1 folder and ran phpize, then I ran ./configure. Everything seemed to run well with no perceived errors.

但是当我运行make"命令时出现错误.这是我得到的输出:

But then I got errors when I ran the "make" command. Here is the output I got:

> Terrys-MacBook-Pro:xdebug-2.6.1 terry$ make /bin/sh
> /Applications/XAMPP/xamppfiles/xdebug-2.6.1/libtool --mode=compile cc 
> -I. -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -DPHP_ATOM_INC -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/include -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/main -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c -o
> xdebug_compat.lo   cc -I.
> -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -DPHP_ATOM_INC -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/include -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1/main -I/Applications/XAMPP/xamppfiles/xdebug-2.6.1 -I/Applications/XAMPP/xamppfiles/include/php -I/Applications/XAMPP/xamppfiles/include/php/main -I/Applications/XAMPP/xamppfiles/include/php/TSRM -I/Applications/XAMPP/xamppfiles/include/php/Zend -I/Applications/XAMPP/xamppfiles/include/php/ext -I/Applications/XAMPP/xamppfiles/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c 
> -fno-common -DPIC -o .libs/xdebug_compat.o /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c:56:71:
**> error: too few arguments to function call, expected 6, have 5**
>         return zend_get_zval_ptr(op_type, node, zdata, &should_free, BP_VAR_R);
>                ~~~~~~~~~~~~~~~~~                                             ^
> /Applications/XAMPP/xamppfiles/include/php/Zend/zend_execute.h:330:1:
> note: 'zend_get_zval_ptr' declared here ZEND_API zval
> *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type); ^ /Applications/XAMPP/xamppfiles/include/php/main/php_config.h:9:19:
> note: expanded from macro 'ZEND_API'
> # define ZEND_API __attribute__ ((visibility("default")))
>                   ^ /Applications/XAMPP/xamppfiles/xdebug-2.6.1/xdebug_compat.c:194:88:
> error: too few arguments to function call, expected 9, have 8
>         php_setcookie(name_s, value_s, expires, path_s, domain_s, secure, url_encode, httponly);
>         ~~~~~~~~~~~~~                                                                         ^ /Applications/XAMPP/xamppfiles/include/php/ext/standard/head.h:40:1:
> note: 'php_setcookie' declared here PHPAPI int
> php_setcookie(zend_string *name, zend_string *value, time_t expires,
> zend_string *path, zend_string *domain, int secure, int httponly,
> zend_string *samesite, int url_encode); ^
> /Applications/XAMPP/xamppfiles/include/php/main/php.h:72:18: note:
> expanded from macro 'PHPAPI'
> #               define PHPAPI __attribute__ ((visibility("default")))
>                               ^ 2 errors generated. make: *** [xdebug_compat.lo] Error 1

所以我在make"命令中看到的第一个错误是>"错误:函数调用的参数太少,预期为 6,有 5".

So the first error I see in the "make" command is "> error: too few arguments to function call, expected 6, have 5".

我不知道从哪里开始.我读过的无穷无尽的文档似乎适用于 PC 或 PHP 5.

I have no idea where to go from here. The endless documents I've read either seem to be for PC or for PHP 5.

推荐答案

这里有一个错误.链接是这样的:https://bugs.xdebug.org/view.php?id=1593

There is a bug for this. The link is thus: https://bugs.xdebug.org/view.php?id=1593

其中描述您现在需要使用 Xdebug 2.7.0beta1.

Which describes that you need to use Xdebug 2.7.0beta1 for now.

这篇关于在 Mac 上使用 XAMPP 安装 XDebug for PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆