简体   繁体   English

我在哪里可以下载Xdebug for PHP和Mac OS X?

[英]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. 我去了xdebug网站,但我找不到mac下载。 http://www.xdebug.org/download.php http://www.xdebug.org/download.php

Did I miss something? 我错过了什么? NetBeans tells me to get xdebug for setting up an PHP development environment on the mac. NetBeans告诉我获取xdebug以在mac上设置PHP开发环境。

You can just use the PECL download option, but you'll need to add a sudo 你可以使用PECL下载选项,但是你需要添加一个sudo

sudo pecl install xdebug

Then set the path to xdebug in your php.ini file. 然后在php.ini文件中设置xdebug的路径。 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.) (您需要在安装完成后重新启动Apache,方法是通过命令行或在“系统偏好设置”中关闭再打开Web共享。)

HTH HTH

Use Homebrew . 使用Homebrew

brew install php55-xdebug

Or php56-xdebug or php70-xdebug depending on your PHP version. 或者php56-xdebugphp70-xdebug具体取决于您的PHP版本。

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. 或者,也许这个关于让xdebug使用macports在mac os x上工作的教程会有所帮助。

If you have pecl, this would be a good way. 如果你有pecl,这将是一个好方法。

# pecl install xdebug

If you don't have pecl, you may want to ckeck it out. 如果你没有pecl,你可能想把它搞砸。

5 years later, OSX is now bundled with Xdebug. 5年后,OSX现在与Xdebug捆绑在一起。 For those who came here with Google : just copy-paste the following in your terminal to activate the extension : 对于那些来到谷歌的人:只需在终端中复制粘贴以下内容即可激活扩展程序:

Mavericks 10.9 小牛队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 山狮10.8

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

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 如果您的macOS是10.14 Mojava,xdebug 2.5.5捆绑在/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 如果你想编译xdebug而你正在使用laravel,请查看此https://github.com/laravel/framework/issues/27052以获取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. 如果你想使用pecl来安装xdebug,你需要先使用brew来安装php,因为与Mojava捆绑在一起的php 7.1.9没有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 eg 5.3 and copy the xdebug.so file from there into your php extensions folder. 最简单的方法是从这里获取由Komodo维护的预编译二进制文件(选择最新的'PHP远程调试客户端'包),然后解压缩它,找到与您的PHP版本对应的文件夹,例如5.3并复制xdebug.so文件从那里到你的PHP扩展文件夹。

Then adjust php.ini as outlined in the other posts. 然后按照其他帖子中的说明调整php.ini。

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

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