2012-04-14 243 views
5

我一直在尝试为Mac OS X Lion启用Xdebug,但无法使其工作。 这应该是非常简单的,但它只是不适合我。在Mac OS X Lion上启用Xdebug Lion

这是我采取的步骤:

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也不起作用。

我错过了一个步骤吗?

回答

7

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

+0

噢,我的上帝......就是这样。我没有激活html_errors。非常感谢Mike。我现在感到很傻... – 2012-04-14 22:34:27

+1

它发生在我们身上。 – 2012-04-15 02:57:37

+0

我是新来的,迈克。所以不幸的是我不能投你的答案。但是,多谢队友! – 2012-04-15 03:20:26

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] 
+0

不可思议!拼错一个字符串:xdebug.remote_handler =“dbgp” – gsscoder 2012-06-06 14:58:56