1.下载xdebug文件

http://xdebug.org/wizard.php

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

全部下载地址:

http://www.xdebug.org/download.php

Instructions

Download xdebug-2.3..tgz
Unpack the downloaded file with tar -xvzf xdebug-2.3..tgz
Run: cd xdebug-2.3.
Run: phpize (See the FAQ if you don't have phpize. As part of its output it should show: Configuring for:
...
Zend Module Api No:
Zend Extension Api No:
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step. Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-
Edit /etc/php.ini and add the line
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-/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官网查看。http://brew.sh/
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
然后安装 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 =
xdebug.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”

项目地址:https://github.com/mac-cain13/xdebug-helper-for-chrome

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

6.其他:

重启apache

sudo apachectl restart

修改php.ini权限

sudo chmod 0777 php.ini

编辑php.ini文件

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

最新文章

  1. 【oracle】union、union all、intersect、minus 的用法及区别
  2. salesforce 零基础开发入门学习(十三)salesforce中JSON的使用
  3. hdfs 名称节点和数据节点
  4. Linux内核设计第七周 ——可执行程序的装载
  5. velocity 显示List和Map方法
  6. 基于jdk proxy的动态代理模式
  7. 二项分布 多项分布 伽马函数 Beta分布
  8. 配置 ASP.NET Linux( CentOS 6.5 ) 运行环境 MONO + Jexus
  9. mysql 限制并发select patch
  10. java 泛型详解(普通泛型、 通配符、 泛型接口)
  11. 【BZOJ 3926】【ZJOI 2015】诸神眷顾的幻想乡
  12. ios 初体验<窗口的创建>
  13. dojo表格分页插件报错
  14. “百度杯”CTF比赛 九月场_SQL
  15. [TPYBoard - Micropython之会python就能做硬件 8] 学习使用超声波模块制作避障小车
  16. Golang——垃圾回收GC
  17. django-models层
  18. LOJ.2863.[IOI2018]组合动作(交互)
  19. 【贪心算法】POJ-3040 局部最优到全局最优
  20. warning LNK4099: PDB 'vc100.pdb' was not found... 解决方案

热门文章

  1. tabhost 下 setOnItemClickListener失效的问题
  2. 字符串转换为数字---使用java7的装箱功能
  3. js,css控制网页内容不让选中和复制
  4. webpack配置ES6 + react套装开发
  5. finally回收资源
  6. myeclipse tomcat内存溢出解决方法
  7. 关于shiro
  8. 输出 n=6 的三角数字阵(JAVA基础回顾)
  9. SQL Server 2016五大优势挖掘企业用户数据价值
  10. Dropbox创造共享新思维——Datastore API