我对XDebug感到头疼,我无法安装它。 我在官方网站上下载了源代码:
git clone git://github.com/xdebug/xdebug.git
然后,我知道我已经安装了预安装的PHP版本,所以我通过以下方式调用phpize:
sudo /Applications/XAMPP/xamppfiles/bin/phpize
它让我输出:
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
似乎一切正常。
唯一可能出错的是doc说我应该得到:
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
然后,我使用./configure
输出:
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
似乎没问题。
然后,按照官方文档,我做:sudo make
输出:
/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'.
似乎没关系。 然后:
cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/php-5.3.0/extensions/no-debug-non-zts-20090626
最后,我编辑:
/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
我重新启动服务器,我总是:
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
我哪里错了?
我尝试了所有方法,二进制文件,pecl等......没有任何工作。
答案 0 :(得分:0)
您可以使用xdebug默认值。
在/Applications/XAMPP/xamppfiles/etc/php.ini中编辑,将xdebug.so的位置分配给zend_extension
private var panRec: UIPanGestureRecognizer!
private var lastSwipeBeginningPoint: CGPoint?
override func viewDidLoad() {
panRec = UIPanGestureRecognizer(target: self, action: #selector(ViewController.handlePan(recognizer:)))
self.view.addGestureRecognizer(panRec)
}
func handlePan(recognizer: UISwipeGestureRecognizer) {
if recognizer.state == .began {
lastSwipeBeginningPoint = recognizer.location(in: recognizer.view)
} else if recognizer.state == .ended {
guard let beginPoint = lastSwipeBeginningPoint else {
return
}
let endPoint = recognizer.location(in: recognizer.view)
// TODO: use the x and y coordinates of endPoint and beginPoint to determine which direction the swipe occurred.
}
}
并重新启动lampp和Xdebug。