1、安装xdebug
xdebug安装的版本要找对应,php版本5.6以下就安装2.5.5版本号
//下载安装包
wget http://pecl.php.net/get/xdebug-2.5.5.tgz
//解压并进入文件
tar xzf xdebug-2.5.5.tgz && cd xdebug-2.5.5/
phpize
//php-config的路径是你安装的路径
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
安装好之后,记住xdebug.so安装的位置
2、修改php.ini配置
修改php.ini配置,在配置最后加上一下代码
[xdebug]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.enable=1
xdebug.remote\_enable=1
;自动启动,无需XDEBUG\_SESSION\_START=1
xdebug.remote\_autostart=1
;;宿主机IP,就是你phpstrom安装的机器的ip
xdebug.remote\_host=172.16.0.249
;;这个端口保持跟phpstrom一致
xdebug.remote\_port=19001
xdebug.remote\_handler=dbgp
配置好之后保存重启php-fpm
3、配置phpstrom
改debug
改server
添加调试,打开Run->EditConfigurations-> 增加一个 PHP WEBAPPlication 的调试点
然后按绿色小虫就能断点调试了
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。