idea php配置,IDEA+PHP+XDebug调试配置

搜索热词

XDebug调试配置

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

安装xdebug

下载最新并解压

wget https://xdebug.org/files/xdebug-2.5.4.tgz

tar zxvf xdebug-2.5.4.tgz

cd xdebug-2.5.4/

编译

按照README里的步骤安装

./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版本

``` bash

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:

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配置信息

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

2918e09c357e5a2545aedef384ed3802.png

调试配置

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

e2c9588c35448831daa9f34c5257e9cd.png

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

1ecb9f2c0ead401ad0b97b46c30d898b.png

然后就可以启动调试了

总结

如果觉得编程之家网站内容还不错,欢迎将编程之家网站推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值