Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing XDebug for PHP with XAMPP on Mac

Tags:

php

xampp

xdebug

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.

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

https://xdebug.org/wizard.php

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

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

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

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.

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

So the first error I see in the "make" command is "> error: too few arguments to function call, expected 6, have 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.

like image 373
TBone Avatar asked Dec 29 '18 21:12

TBone


1 Answers

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

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

like image 156
Hannibal Avatar answered Sep 23 '22 10:09

Hannibal