前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >IDEA+PHP+XDebug调试配置

IDEA+PHP+XDebug调试配置

作者头像
JadePeng
发布2018-03-12 16:18:43
1.8K0
发布2018-03-12 16:18:43
举报

XDebug调试配置

临时需要调试服务器上的PHP web程序,因此安装xdebug,下面简单记录

安装xdebug

下载最新并解压
代码语言:javascript
复制
wget https://xdebug.org/files/xdebug-2.5.4.tgz
tar zxvf xdebug-2.5.4.tgz 
cd xdebug-2.5.4/
编译

按照README里的步骤安装

``` bash ./configure --enable-xdebug ···

报错

checking Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 5.5.0 and < 7.2.0 (found 5.3.10-1ubuntu3.21)

原来服务器上的php版本比较低:

PHP 5.3.10-1ubuntu3.26 with Suhosin-Patch (cli) (built: Feb 13 2017 20:37:53) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

最稳妥起见,下载老版本的xdebug,下载2.2.2版本

代码语言:javascript
复制
wget https://xdebug.org/files/xdebug-2.2.2.tgz
tar zxvf xdebug-2.2.2.tgz 
cd xdebug-2.2.2/
./configure --enable-xdebug
make

make完成后,modules下面就有了编译好的xdebug.so:

代码语言:javascript
复制
root@nginx01:/opt/research/xdebug-2.2.2# ll modules/
total 808
drwxr-xr-x 2 root root   4096 Jun 19 14:17 ./
drwxr-xr-x 9 root root   4096 Jun 19 13:10 ../
-rw-r--r-- 1 root root    939 Jun 19 13:09 xdebug.la
-rwxr-xr-x 1 root root 814809 Jun 19 13:09 xdebug.so*
配置

修改php.ini,服务器使用的php5-fpm,配置文件在/etc/php5/fpm/php.ini

修改,增加xdebug配置信息

代码语言:javascript
复制
zend_extension="/opt/research/xdebug-2.2.2/modules/xdebug.so"
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_port = 9001 #端口9001
xdebug.remote_connect_back = 1 
#xdebug.remote_host= 192.168.xxx.xxx
xdebug.idekey = PHPSTORM
xdebug.remote_log = /opt/research/xdebug-2.2.2/xdebug.log

IDEA 配置

配置xdebug端口为9001

在设置里搜索XDEBUG,配置端口9001

enter description here
enter description here
调试配置

在RUN-Edit Configuratins里,新增PHP Web Application

enter description here
enter description here

Server新增服务器地址,Debugger设置为Xdebug,将服务器上的绝对地址,映射到本地

XDEBUG配置
XDEBUG配置

然后就可以启动调试了

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-06-19 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • XDebug调试配置
    • 安装xdebug
      • 下载最新并解压
      • 编译
      • 配置
    • IDEA 配置
      • 配置xdebug端口为9001
      • 调试配置
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档