简体   繁体   中英

Installing XDebug with Mac OS 10.9 and XAMPP

I'm getting an headache with XDebug, I can't install it. I download the source in the official site :

git clone git://github.com/xdebug/xdebug.git

then, I know I have a preinstalled version of PHP installed, so I invoke phpize by :

sudo /Applications/XAMPP/xamppfiles/bin/phpize

it get me the output :

    Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
configure.in:3: warning: prefer named diversions
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2046: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2059: AC_CACHE_CHECK is expanded from...
aclocal.m4:3585: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5597: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3109: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2967: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2046: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2059: AC_CACHE_CHECK is expanded from...
aclocal.m4:3548: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:8133: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
aclocal.m4:5597: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3109: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2967: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2046: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2059: AC_CACHE_CHECK is expanded from...
aclocal.m4:3548: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:8133: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
aclocal.m4:6549: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4737: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3109: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2967: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:3: warning: prefer named diversions
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2046: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2059: AC_CACHE_CHECK is expanded from...
aclocal.m4:3585: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5597: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3109: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2967: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2046: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2059: AC_CACHE_CHECK is expanded from...
aclocal.m4:3548: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:8133: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
aclocal.m4:5597: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:3109: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2967: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:2046: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2059: AC_CACHE_CHECK is expanded from...
aclocal.m4:3548: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:8133: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
aclocal.m4:6549: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4737: _LT_AC_TAGCONFIG is expanded from...
aclocal.m4:3109: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2967: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2947: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level

It seems everything is OK.

the only thing that could be wrong is that doc says I should get :

Zend Module Api No:      20090626
Zend Extension Api No:   220090626

then, I use ./configure

output:

    checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-apple-darwin13.3.0
checking host system type... i686-apple-darwin13.3.0
checking target system type... i686-apple-darwin13.3.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20100525
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable eXtended debugging support... yes, shared
checking Check for supported PHP versions... supported (5.4.24)
checking for gettimeofday... yes
checking for cos in -lm... yes
checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking if cc static flag  works... rm: conftest.dSYM: is a directory
yes
checking if cc supports -fno-rtti -fno-exceptions... rm: conftest.dSYM: is a directory
yes
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if cc supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin13.3.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged

it seems OK.

Then, following the official documentation, I do : sudo make

output :

/bin/sh /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/libtool --mode=compile cc  -I. -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5 -DPHP_ATOM_INC -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/include -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/main -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/xdebug.c -o xdebug.lo 
mkdir .libs
/bin/sh /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/libtool --mode=compile cc  -I. -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5 -DPHP_ATOM_INC -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/include -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/main -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/xdebug_handler_dbgp.c -o xdebug_handler_dbgp.lo 
 cc -I. -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5 -DPHP_ATOM_INC -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/include -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/main -I/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/xdebug_handler_dbgp.c  -fno-common -DPIC -o .libs/xdebug_handler_dbgp.o
/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/xdebug_handler_dbgp.c:1328:21: warning: incompatible pointer types initializing 'jmp_buf *' (aka 'int (*)[37]')
      with an expression of type 'sigjmp_buf *' (aka 'int (*)[38]') [-Wincompatible-pointer-types]
        jmp_buf           *original_bailout = EG(bailout);
                           ^                  ~~~~~~~~~~~
/Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/xdebug_handler_dbgp.c:1363:14: warning: incompatible pointer types assigning to 'sigjmp_buf *' (aka 'int (*)[38]')
      from 'jmp_buf *' (aka 'int (*)[37]') [-Wincompatible-pointer-types]
        EG(bailout) = original_bailout;
                    ^ ~~~~~~~~~~~~~~~~
2 warnings generated.

[... log cut to fit allowed chars]

creating xdebug.la
(cd .libs && rm -f xdebug.la && ln -s ../xdebug.la xdebug.la)
/bin/sh /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/libtool --mode=install cp ./xdebug.la /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/modules
cp ./.libs/xdebug.so /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/modules/xdebug.so
cp ./.libs/xdebug.lai /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/modules/xdebug.la
----------------------------------------------------------------------
Libraries have been installed in:
   /Users/admin/Downloads/xdebug-2.2.5/xdebug-2.2.5/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

It seems to be OK to. Then:

cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/php-5.3.0/extensions/no-debug-non-zts-20090626

and Finally, I edit :

/Applications/XAMPP/xamppfiles/etc/php.ini and add the line
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/php-5.3.0/extensions/no-debug-non-zts-20090626/xdebug.so

I restart the server, and I always have :

 Summary

 Xdebug installed: no
 Server API: Apache 2.0 Handler
 Windows: no
 Zend Server: no
 PHP Version: 5.3.0
 Zend API nr: 220090626
 PHP API nr: 20090626
 Debug Build: no
 Thread Safe Build: no
 Configuration File Path: /Applications/XAMPP/xamppfiles/etc
 Configuration File: /Applications/XAMPP/xamppfiles/etc/php.ini
 Extensions directory: /Applications/XAMPP/xamppfiles/lib/php/php-5.3.0/extensions/no-debug-non-zts-20090626

Where am I wrong?

I tried all the ways, binaries, pecl, etc... nothing is working.

You can used xdebug default.

edited in /Applications/XAMPP/xamppfiles/etc/php.ini assigned the location of xdebug.so to zend_extension

[xdebug]
zend_extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"
;change no-debug-non-zts-20131226 for your folder
;debug remote
xdebug.remote_enable=on
xdebug.remote_port =9000
xdebug.remote_enable = 1

and restart lampp and Xdebug is installed.

info: Xdebug with XAMPP in Ubuntu 14.04

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