php - 在 Mac 上使用 XAMPP 安装 XDebug for PHP

标签 php xampp xdebug

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

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

https://xdebug.org/wizard.php

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

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

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

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

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

> 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”。

我不知道从这里去哪里。我读过的无穷无尽的文档似乎是针对 PC 或 PHP 5 的。

最佳答案

这有一个错误。因此链接是:https://bugs.xdebug.org/view.php?id=1593

其中说明您现在需要使用 Xdebug 2.7.0beta1。

关于php - 在 Mac 上使用 XAMPP 安装 XDebug for PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53973545/

相关文章:

php - 在 PHP 中处理 Python 异常/错误

php - 无法连接到 mysql php/xampp

php - 将 mysql 更改为 mysqli 及其 xampp 版本

php - xDebug 没有在断点处停止

php - 为什么带有 mysqli 的面向对象的 PHP 比过程方法更好?

php - 我如何正确创建一个 PHP 数组以便稍后循环并获取每条信息?

php - 在没有路由的情况下执行 Yii 模块

php - 将图像从 android 上传到 PHP 服务器

xdebug 没有与客户端连接?

php - 调试器未附加 - Xdebug - Atom (php)