Enabling Xdebug on Mac OS X Lion

2020-07-15 03:07发布

i've been trying to enable Xdebug for Mac OS X Lion, but can't make it work. 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:

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

2 - Restarted my Apache Server with

sudo apachectl restart

3 - Checked that it is enabled via the phpinfo() function. It is in fact enabled both as Zend module and as a separate module.

But it doesn't work. Everytime an error occurs in my php scripts, they are displayed using the ugly error handling by default. var_dumps also don't work.

Am I missing a step?

3条回答
▲ chillily
2楼-- · 2020-07-15 03:45

Xdebug.org's tailored installation wizard worked for me.

(using built-in apache)

查看更多
Evening l夕情丶
3楼-- · 2020-07-15 03:46

Be sure your html_errors and display_errors are turned on via your php.ini file.

查看更多
地球回转人心会变
4楼-- · 2020-07-15 03:52

I've the same problem.

I was previously be able to activate it using MAMP. Anyway this environment created problems and I've installed a standalone mysql and activated Mac OS Lion's apache.

I've recompiled xdebug.so and modified /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.

What I am missing?

php-config output:

$ 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]
查看更多
登录 后发表回答