简体   繁体   中英

Install xdebug on MacOS High Sierra

I try to install xdebug with php 7.2 on my mac and I just can't get it installed. I have followed several guides and nothing worked.

Things I have tried:

The main errors I get come in the make -step (when run manually as well as when run by pecl).

    /bin/sh /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/libtool --mode=compile cc   -I. -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0 -DPHP_ATOM_INC -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/include -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/main -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0 -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 /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c -o xdebug.lo 
mkdir .libs
 cc -I. -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0 -DPHP_ATOM_INC -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/include -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/main -I/Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0 -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 /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c  -fno-common -DPIC -o .libs/xdebug.o
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:143:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     max_nesting_level;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:144:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     max_stack_frames;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:147:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     collect_params;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:165:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     force_error_reporting;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:166:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     halt_level;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:168:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     overload_var_dump;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:182:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     trace_options;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:183:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     trace_format;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:189:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     display_max_children;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:190:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     display_max_data;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:191:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     display_max_depth;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:246:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     remote_port;    /* 9000 */
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:254:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     remote_cookie_expire_time; /* Expire time for the remote-session cookie */
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:256:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     remote_connect_timeout; /* Timeout in MS for remote connections */
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:313:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     filter_type_tracing;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:314:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     filter_type_profiler;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:52:
./php_xdebug.h:315:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long     filter_type_code_coverage;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:57:
./xdebug_gc_stats.h:23:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long    collected;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
In file included from /Users/my_name/Downloads/xdebug-2.6.0/xdebug-2.6.0/xdebug.c:57:
./xdebug_gc_stats.h:24:2: error: unknown type name 'zend_long'; did you mean 'zend_ulong'?
        zend_long    duration;
        ^~~~~~~~~
        zend_ulong
/Applications/XAMPP/xamppfiles/include/php/Zend/zend_types.h:28:23: note: 'zend_ulong' declared here
typedef unsigned long zend_ulong;
                      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [xdebug.lo] Error 1

Then I looked into having a docker instance of xdebug running, but I don't have enough experience with docker.

This is bothering me for weeks now, I can't see it anymore - please help :)

I have been struggling with installing xdebug for use with XAMPP and I have seen this type of output in one of my earlier tries. I don't know if this applies, but I thought I'd add in my two cents.

From the error outputs, it looks like you unpacked the xdebug in the downloads folder. The xdebug wizard instructions say to unpack it in the /Applications/XAMPP/xamppfiles/ folder. This helps a little because you should be running the phpize, ./configure, etc... from the /Applications/XAMPP/xamppfiles/xdebug-2.6.1/ folder.

One other thing I had to do to get the ./configure to work was to place the /Applications/XAMPP/xamppfiles/bin in the path BEFORE everything else so that the correct phpize command is called. After that, the ./configure ran (I think) without any problems. I am however, stuck at the "make" instruction from the wizard. In fact, I'm composing a question now to that issue when I came across your post. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM