开发者

Where can I download Xdebug for PHP and Mac OS X?

I went to the xdebug site, but I can't find a mac download. http://www.xdebug.org/download.php

Did I miss something? NetBeans tells me to get xdebu开发者_运维问答g for setting up an PHP development environment on the mac.


You can just use the PECL download option, but you'll need to add a sudo

sudo pecl install xdebug

Then set the path to xdebug in your php.ini file. If everything is still at the default I'd imagine you'd need:

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

However, you can check your extensions directory via:

pecl config-get ext_dir

(You will need to restart Apache after this install, either via the command line or by turning web sharing off and on again in System Preferences.)

HTH


Use Homebrew.

brew install php55-xdebug

Or php56-xdebug or php70-xdebug depending on your PHP version.


You will need to compile it from source. Or alternatively, maybe this tutorial on getting xdebug working on mac os x with macports will help.


If you have pecl, this would be a good way.

# pecl install xdebug

If you don't have pecl, you may want to ckeck it out.


If your macOS is 10.14 Mojava, xdebug 2.5.5 was bundled in /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so

If you want to compile xdebug and you are using laravel, check this https://github.com/laravel/framework/issues/27052 for Compatability Notice

PHP 7.2.x + xdebug 2.6.x all good. 
PHP 7.3.0 + xdebug 2.7.0beta1 known issues. 
PHP 7.3.1 + xdebug master branch all good. // I can verify this is NOT the case, 
//no xdebug commits so far (2019-01-24) work for php 7.3.1, as least not working on my mac

If you want to use pecl to install xdebug, you will need to use brew to install php first because php 7.1.9 bundled with Mojava does not have pecl.


The simplest way is to get the precompiled binaries maintained by Komodo from here (choose the most recent 'PHP Remote Debugging Client' package), then unzip it, find the folder that corresponds to your version of PHP e.g. 5.3 and copy the xdebug.so file from there into your php extensions folder.

Then adjust php.ini as outlined in the other posts.


5 years later, OSX is now bundled with Xdebug. For those who came here with Google : just copy-paste the following in your terminal to activate the extension :

Mavericks 10.9

sudo sh -c 'echo "zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so" >> /etc/php.ini && apachectl restart'

Mountain Lion 10.8

sudo sh -c 'echo "zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" >> /etc/php.ini && apachectl restart'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜