• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

w00fz/xdebug-osx: Simple bash script to toggle xdebug on/off in OSX

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

w00fz/xdebug-osx

开源软件地址:

https://github.com/w00fz/xdebug-osx

开源编程语言:

Shell 100.0%

开源软件介绍:

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 [email protected]: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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap