XDebug with php('--enable-debug=YES')


XDebug with php('--enable-debug=YES')

我正在尝试使用XDebug(php模式'./configure''--带有-apxs2=/usr/sbin/apxs''--启用调试=YES')。

在xdebug的文档中:"如果您自己编译PHP并使用--enable调试,则必须使用zend_extension_debug"。

但是,在输出phpinfo()模块中没有加载(我也尝试过使用zend_extension)。

[xdebug]
zend_extension_debug=/usr/lib/php/extensions/debug-non-zts-20121212/xdebug.so
xdebug.remote_enable = on
xdebug.remote_port = 9001
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"

也许XDebug需要一些模块
我加载的模块:

[PHP Modules]
Core
ctype
date
dom
ereg
fileinfo
filter
hash
iconv
json
libxml
mcrypt
memorylog
mongo
pcre
PDO
pdo_sqlite
phalcon
Phar    
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter

还有一件事:
我有2个php版本的单mac。在编译XDebug之前,我使用phpize(5.5.15),但"make-install"将扩展复制到不同的路径(/usr/local/lib/php/extension/no-debug-non-zts-2011212/XDebug.so)

但是phpinfo()5.5.15输出不同的扩展目录"/usr/lib/php/extensions/debug-non-zts-20121212"。

现在,我将xdebug.so从"/usr/local/lib/php/extension/no-debug-non-zts-2012122/"复制到"/usr/lib/php/extension/debug-non-zts-20121212/",但不起作用。

您可能不再需要这个答案了,但无论如何:

Xdebug不需要任何其他模块。

我的猜测是,在使用--enable-debug为php编译xdebug之前,您调用了来自系统上另一个已安装php的phpize。您应该像full'path'to'another'phpize一样运行它,这样它就可以通过--enabledebug为php设置正确的设置。

在php.ini中包含enable xdebug的正确方法是zend_extension="/path/to/xdebug.so"

希望能有所帮助。