mac xdebug php,mac+php+xdebug+phpstorm在苹果下配置xdebug一波三折

1.下载xdebug文件

外链网址已屏蔽

将phpinfo()的源代码复制到文本框中,xdebug会提示如何配置和下载哪个版本的xdebug。

全部下载地址:

外链网址已屏蔽

Instructions

Download xdebug-2.3.3.tgz

Unpack the downloadedfile with tar -xvzf xdebug-2.3.3.tgz

Run: cd xdebug-2.3.3Run: phpize (See the FAQif you don't have phpize.

As part of its output it should show:

Configuringfor:

...

Zend Module Api No:20121212Zend Extension Api No:220121212If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

Run: ./configure

Run:makeRun:cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20121212Edit/etc/php.ini and add the line

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

Restart the webserver

在xdebug官网会有许多安装提示。其中可能会出现的问题有:

phpize没有安装:继而又要安装brew,再安装autoconf可谓一波三折

2.解决相关组件不全的问题

问题描述

Mac系统升级到10.9(mavericks)时安装php扩展,执行 phpize 提示如下错误:

Cannot find autoconf. Please check your autoconf installation

and the $PHP_AUTOCONF environment variable.

解决办法

先安装Homebrew:如果以下链接失效的话,可以到brew官网查看。外链网址已屏蔽

ruby -e "$(curl -fsSL 外链网址已屏蔽)"

然后安装 autoconf:

brew install autoconf

3.配置php.ini

在xdebug官网上的配置,只能够正确配置好xdebug但是不能与phpstorm进行配置。在php.ini末尾加上如下代码:

[xdebug]

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

xdebug.remote_handler= "dbgp"xdebug.remote_host= "localhost"xdebug.remote_port= 9000xdebug.idekey= PHPSTROM

4.配置phpstorm

打开phpStorm,

-进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填localhost,host填localhost,port填80,debugger选XDebug

-进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认

-进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填80

-点OK退出设置。

在phpStorm里打开监听(电话按钮)。

5.chrome的xdebug配置

在IDE key里将其配置成“phpStorm”

项目地址:外链网址已屏蔽

好了,到此就可以配置完成了,有问题的话可以给我留言,大家一起交流。

6.其他:

重启apache

sudo apachectl restart

修改php.ini权限

sudo chmod 0777 php.ini

编辑php.ini文件

sudo vi php.ini(修改i,退出:q,保存退出:wq)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值