xdebug-osx

Simple bash script to toggle xdebug on/off in OSX
授权协议 MIT License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 胥康安
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Xdebug Toggler for OSX

Xdebug is a must have extension for PHP, although the times you don't actually need it, it's a drag.

This simple script allows to toggle on and off Xdebug and is meant for anyone running PHP and Xdebug installed via Homebrew.

You can follow the OS X Apache Setup guide, divided in two parts, to get the perfect MAMP setup on OSX:

This script is inspired by the great sphp script. Which I highly suggest to install if you need to switch easily between php versions.However since it's been quite inactive I am now running and maintaning my own implementation. You can get it from https://gist.github.com/w00fz/142b6b19750ea6979137b963df959d11

Quick Installation

curl -L https://raw.githubusercontent.com/w00fz/xdebug-osx/master/xdebug-toggle > /usr/local/bin/xdebug-toggle

Installation with clone

git clone git@github.com:w00fz/xdebug-osx.git

Add /usr/local/bin to your $PATH. If you use the Bash shell, you can do this by running this command:

echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bashrc

You may need to restart your shell for this to take effect, or refresh it with source ~/.bashrc.

If you want the global command then run:

cd xdebug-osx
ln -s `pwd`/xdebug-toggle /usr/local/bin/xdebug-toggle

Make sure xdebug-toggle is executable

chmod +x /usr/local/bin/xdebug-toggle

Xdebug installation and configuration

Homebrew does not provide a keg for Xdebug anymore, so you must install Xdebug extension via pecl

pecl channel-update pecl.php.net
pecl install xdebug

xdebug-toggle needs a file called ext-xdebug.ini in brew's php conf.d directory to work, which must contain, at least, the following:

zend_extension="xdebug.so"

Make sure that php.ini doesn't contain this line too.

It's recommended to keep al xdebug config in this file, as an example:

[xdebug]
zend_extension="xdebug.so"

xdebug.var_display_max_depth=24
xdebug.remote_port=9000
xdebug.remote_enable=1
xdebug.remote_connect_back=1

Usage

xdebug-toggle                            # outputs the current status
xdebug-toggle on                         # enables xdebug
xdebug-toggle off                        # disables xdebug
xdebug-toggle on|off --no-server-restart # toggles xdebug without restarting apache or php-fpm

License

LICENSE

  • 我在使用MAMP在Mac OSX上构建/安装XDebug时遇到问题. 到目前为止,我在网上广泛搜索,目前我被困在XDebug“安装向导”的一部分,告诉我在我下载的源代码上“运行:PHPize”. 当我运行PHPize时,我收到以下消息: new-host-2:xdebug-2.2.0 Dima$PHPize grep: /usr/include/PHP/main/PHP.h: No such fi

  • 我想我会尝试使用nginx而不是Apache,看看它是如何工作的,我已经启动并运行了,但我不能为了生命的缘故弄清楚如何让PhpStorm捕获传入的xdebug连接.当我运行Apache时,它运行得很好. 通常,你会在PhpStorm中获得一个“传入连接”窗口 – 这个窗口现在闪耀着它的缺席 – 是的;我已经阅读了StackOverflow上的每一个PhpStorm / Xdebug问题,但都没有解

  • 我有以下设置: >运行MySQL的OSX侦听端口3306上的所有网络适配器 > XDEBUG启用IDE侦听基本OSX系统上的端口9000. >使用主机IP 192.168.99.100在OSX系统上运行的docker-machine主机 >一个基于debian的docker容器,在docker主机上运行MysqL客户端,运行xdebug的HHVM希望连接到端口9000上的一些幸运远程主机. 由于通

 相关资料
  • Xdebug is an extension for PHP to assist with debugging and development. It contains a single step debugger to use with IDEs it upgrades PHP's var_dump() function it adds stack traces for Notices, War

  • 合适的调试器是软件开发中最有用的工具之一,它使你可以跟踪程序执行结果并监视程序堆栈中的信息。 Xdebug 是一个 php 的调试器,它可以被用来在很多 IDE(集成开发环境) 中做断点调试以及堆栈检查。它还可以像 PHPUnit 和 KCacheGrind 一样,做代码覆盖检查或者程序性能跟踪。 如果你仍在使用 var_dump()/print_r() 调错,经常会发现自己处于困境,并且仍然找不

  • xdebug是一个开源的php调试器,以php模块的形式加载并被使用。

  • 问题内容: 我认为自从安装XDebug之后,我的服务器就变慢了。因此,为了检验我的假设,我想完全禁用XDebug。我一直在寻找有关如何执行此操作的教程,但找不到此类信息。 问题答案: 查找您的内容并寻找XDebug。 将xdebug自动启动设置为false 禁用您的分析器 请注意,即使禁用xdebug但已加载,也可能会导致性能下降。要禁用扩展本身的加载,您需要在php.ini中对其进行注释。查找如

  • 我试图用VScode设置Xdebug,但是每当我设置断点时,它就会忽略它。 PHP-V 感谢您的阅读!

  • 文档内容来自 xdebug.org/docs,翻译时 xdebug 版本为 2.6。我在官方文档基础上针对中文排版和教程内容的编排做了一些优化,希望中文文档看起来更容易理解。