博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IDEA+PHP+XDebug调试配置
阅读量:7056 次
发布时间:2019-06-28

本文共 1524 字,大约阅读时间需要 5 分钟。

XDebug调试配置

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

安装xdebug

下载最新并解压

wget https://xdebug.org/files/xdebug-2.5.4.tgztar 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版本

wget https://xdebug.org/files/xdebug-2.2.2.tgztar zxvf xdebug-2.2.2.tgz cd xdebug-2.2.2/./configure --enable-xdebugmake

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

root@nginx01:/opt/research/xdebug-2.2.2# ll modules/total 808drwxr-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 = Onxdebug.remote_handler = dbgpxdebug.remote_port = 9001 #端口9001xdebug.remote_connect_back = 1 #xdebug.remote_host= 192.168.xxx.xxxxdebug.idekey = PHPSTORMxdebug.remote_log = /opt/research/xdebug-2.2.2/xdebug.log

IDEA 配置

配置xdebug端口为9001

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

enter description here

调试配置

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

enter description here

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

XDEBUG配置

然后就可以启动调试了

转载地址:http://nzlol.baihongyu.com/

你可能感兴趣的文章
Loadrunner 关于参数赋值取值的操作
查看>>
C# 实现保留两位小数的方法
查看>>
Http协议4个新的http状态码:428、429、431、511;
查看>>
C#类型简述
查看>>
Go:字符串操作
查看>>
EXCEL 2010学习笔记 —— VLOOKUP函数 嵌套 MATCH 函数
查看>>
android graphics: 2D animation
查看>>
升级 python 2.6.6 系统到 2.7.10 版本
查看>>
start with connect by prior 递归查询用法
查看>>
OS X 10.11 安装Cocoapods
查看>>
MATLAB测试机器零阈值的大小
查看>>
优化查询
查看>>
odoo开发笔记-自定义发送邮件模板
查看>>
19、集合概述
查看>>
茄子烧豆角
查看>>
Jmeter(三)-简单的HTTP请求(非录制)
查看>>
linux查看系统类型和版本
查看>>
ThinkPHP将上传问件添加到数据库
查看>>
python 不同目录间的模块调用
查看>>
centos7 安装 chrome
查看>>