配置phpstorm + xdebug 调试php
2016-07-26 00:00
323 查看
安装phpstorm,注册码什么的对天朝来说不是四儿。
获取xdebug:git clone git://github.com/xdebug/xdebug.git
cd到目录下,使用phpize将其添加为动态扩展,
报错,Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
于是乎,brew install autoconf安装。
再phpize成功,之后编译文件:
./configure --enable-xdebug && make && make install
小解释下,linux下的C文件,./configure是检查平台目标特征,--prefix参数指定软件安装在参数文件夹下,可执行文件在文件夹下bin目录里,若不写默认在/usr/bin。--enable启动些默认关闭的特性。make是编译make install是安装,都通过makefile来指定
编译完成得到xdebug.so
修改php.ini,添加节点:
[Xdebug]
zend_extension="/Users/guoguo/xdebug/xdebug-2.4.0/modules/xdebug.so"
xdebug.remote_enable = on
;xdebug.remote_handler=dbgp
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9000
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.remote_autostart = on
实际使用中发现MAMP下的php中已有注释掉的[xdebug],打开即可用,后装配的反而不能用,待考证。
打开phpstorm,打开phpstorm->preferences->Languages&Frameworks->php,添加一个解释器interpreter,选到php程序,刷新可看到Debugger由None变成Xdebug,即可使用
获取xdebug:git clone git://github.com/xdebug/xdebug.git
cd到目录下,使用phpize将其添加为动态扩展,
报错,Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.
于是乎,brew install autoconf安装。
再phpize成功,之后编译文件:
./configure --enable-xdebug && make && make install
小解释下,linux下的C文件,./configure是检查平台目标特征,--prefix参数指定软件安装在参数文件夹下,可执行文件在文件夹下bin目录里,若不写默认在/usr/bin。--enable启动些默认关闭的特性。make是编译make install是安装,都通过makefile来指定
编译完成得到xdebug.so
修改php.ini,添加节点:
[Xdebug]
zend_extension="/Users/guoguo/xdebug/xdebug-2.4.0/modules/xdebug.so"
xdebug.remote_enable = on
;xdebug.remote_handler=dbgp
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9000
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.remote_autostart = on
实际使用中发现MAMP下的php中已有注释掉的[xdebug],打开即可用,后装配的反而不能用,待考证。
打开phpstorm,打开phpstorm->preferences->Languages&Frameworks->php,添加一个解释器interpreter,选到php程序,刷新可看到Debugger由None变成Xdebug,即可使用
相关文章推荐
- php -防止sql注入的函数
- gitlab 邮件配置(smtp)
- php环境配置
- 解决thinkPHP3.2.3使用Smarty模板后无法使用系统常量问题
- 配置GitLab 用smtp发邮件 (gitlab-6.7.3)
- php学习笔记(三)select处理
- RHEL 6 TFTP
- PHP——php——zend studio 断点调试
- PHP进阶(一)——数组与函数
- yii 操作session
- PHP中的一些遗漏点
- Cookie for PHP
- PHP中如何设置error_reporting错误报告级别
- PHP环境搭建
- PHP基础入门(三)
- Codeforces Round #293 (Div. 2) C.Anya and Smartphone(模拟)
- php学习笔记(二)php与mysql连接与用php发送SQL查询
- php学习笔记(一)php模板与控制器
- php项目笔记(二)php部分
- php项目笔记(一)mysql准备