在Mac上使用XAMPP安装XDebug for PHP

TBo*_*one 7 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
Run Code Online (Sandbox Code Playgroud)

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

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

Han*_*bal 7

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

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

  • 谢谢汉尼拔!我认为xdebug有问题.通过您的回答,我能够找到xdebug安装向导为执行XAMPP手动安装所提供的相同说明.该链接使用了xdebug-2.7.0alpha1版本,但根据您的说法,我将"alpha"更改为"beta",下载并解压缩.之后,它是与向导相同的基本指令来安装它.这是链接:[手动安装](https://discourse.brew.sh/t/where-is-x-debug-for-php-7-1/1960/5) (2认同)