在Mac OS X Lion上启用Xdebug

时间:2012-04-14 20:41:45

标签: php apache2 osx-lion xdebug

我一直在尝试为Mac OS X Lion启用Xdebug,但无法使其正常工作。 这应该是非常直接的,但它对我不起作用。

这些是我采取的步骤:

1 - 取消注释php.ini文件的这一行:

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

2 - 使用

重新启动我的Apache服务器
sudo apachectl restart

3 - 检查是否通过phpinfo()函数启用了它。实际上,它既可以作为Zend模块启用,也可以作为单独的模块启用。

但它不起作用。每次在我的php脚本中发生错误时,默认情况下都会使用丑陋的错误处理来显示它们。 var_dumps也不起作用。

我错过了一步吗?

3 个答案:

答案 0 :(得分:7)

确保您的html_errorsdisplay_errors已通过php.ini文件启用。

答案 1 :(得分:4)

Xdebug.org's tailored installation wizard为我工作。

(使用内置的apache)

答案 2 :(得分:3)

我遇到了同样的问题。

我以前能够使用MAMP激活它。无论如何这个环境造成了问题,我已经安装了一个独立的mysql并激活了Mac OS Lion的apache。

我已重新编译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

但是我无能为力,我无法将NetBeans 7.1连接到调试器。

我缺少什么?

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]
相关问题