简体   繁体   English

在Mac OS X Lion上启用Xdebug

[英]Enabling Xdebug on Mac OS X Lion

i've been trying to enable Xdebug for Mac OS X Lion, but can't make it work. 我一直在尝试为Mac OS X Lion启用Xdebug,但无法使其正常工作。 This should be pretty straight forward but it just isn't working for me. 这应该是非常直接的,但它对我不起作用。

These are the steps i took: 这些是我采取的步骤:

1 - Uncommented this line of the php.ini file: 1 - 取消注释php.ini文件的这一行:

zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"

2 - Restarted my Apache Server with 2 - 重启我的Apache服务器

sudo apachectl restart

3 - Checked that it is enabled via the phpinfo() function. 3 - 检查是否通过phpinfo()函数启用了它。 It is in fact enabled both as Zend module and as a separate module. 事实上,它既可以作为Zend模块启用,也可以作为单独的模块启用。

But it doesn't work. 但它不起作用。 Everytime an error occurs in my php scripts, they are displayed using the ugly error handling by default. 每次在我的php脚本中发生错误时,默认情况下都会使用丑陋的错误处理来显示它们。 var_dumps also don't work. var_dumps也不起作用。

Am I missing a step? 我错过了一步吗?

确保通过php.ini文件html_errorsdisplay_errors

Xdebug.org's tailored installation wizard worked for me. Xdebug.org的定制安装向导为我工作。

(using built-in apache) (使用内置的apache)

I've the same problem. 我有同样的问题。

I was previously be able to activate it using MAMP. 我以前能够使用MAMP激活它。 Anyway this environment created problems and I've installed a standalone mysql and activated Mac OS Lion's apache. 无论如何这个环境造成了问题,我已经安装了一个独立的mysql并激活了Mac OS Lion的apache。

I've recompiled xdebug.so and modified /private/etc/php.ini : 我重新编译了xdebug.so并修改了/private/etc/php.ini

;...
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
;...
[xdebug]
;xdebug.idekey="macgdbp"
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log="/var/log/xdebug.log"
xdebug.remote_autostart=1

But there's nothing I can do, I'm not able to get NetBeans 7.1 attach to the debugger. 但是我无能为力,我无法将NetBeans 7.1连接到调试器。

What I am missing? 我错过了什么?

php-config output: php-config输出:

$ php-config --help
Usage: /usr/bin/php-config [OPTION]
Options:
  --prefix            [/usr]
  --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]
  --ldflags           [ ]
  --libs              [-lresolv  -lz -lexslt -ltidy -lresolv -ledit -lncurses -lpq -lpq -liodbc -lldap -llber -liconv -liconv -lfreetype -lpng -lz -ljpeg -lcrypto -lssl -lcrypto -lcurl -lbz2 -lz -lpcre -lcrypto -lssl -lcrypto -lm  -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -licucore -lm -liodbc -lxml2 -lz -licucore -lm -lnetsnmp -lcrypto -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxslt -lxml2 -lz -licucore -lm ]
  --extension-dir     [/usr/lib/php/extensions/no-debug-non-zts-20090626]
  --include-dir       [/usr/include/php]
  --man-dir           [/usr/share/man]
  --php-binary        [/usr/bin/php]
  --php-sapis         [cli apache2handler]
  --configure-options [--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --with-curl=/usr --enable-dba --enable-ndbm=/usr --enable-exif --enable-ftp --with-gd --with-freetype-dir=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --enable-gd-native-ttf --with-icu-dir=/usr --with-iodbc=/usr --with-ldap=/usr --with-ldap-sasl=/usr --with-libedit=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-mysqli=mysqlnd --without-pear --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --with-readline=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sqlite-utf8 --enable-suhosin --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr --enable-zend-multibyte --enable-zip --with-pcre-regex=/usr --with-pgsql=/usr --with-pdo-pgsql=/usr]
  --version           [5.3.10]
  --vernum            [50310]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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