鍍金池/ 問答/PHP/ 請問php的xdebug遠(yuǎn)程調(diào)試怎樣配置?工作中常用嗎?

請問php的xdebug遠(yuǎn)程調(diào)試怎樣配置?工作中常用嗎?

服務(wù)器的運(yùn)行環(huán)境

  1. win 2008
  2. apache 2.4
  3. php 7.1.2
  4. 已經(jīng)安裝xdebug 2.5.5

我已經(jīng)找遍百度的文章和sf上的文章,按照文章上面的配置,最終還是失敗,請問哪位大神能教教我?

PS:

  1. 調(diào)試請求的URL的風(fēng)格: http://api.xxx.com/index.php?...
  2. phpstorm中有等待的信息: Waiting for incoming connection with ide key '17466'
回答
編輯回答
淺淺

感覺樓上說的有點(diǎn)麻煩,我用的是世界上最好的編輯器atom。
一、在atom裝上插件php-debug。
二、php.ini末尾加上這段配置,并重啟apache。

[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true

三、就能用啦

2018年8月3日 14:02
編輯回答
只愛你

我不清楚:請問php的xdebug遠(yuǎn)程調(diào)試怎樣配置?
這里我說一下,我常用的兩種。
一:直接在phpstorm里,設(shè)置斷點(diǎn),run debug模式
二:同樣是在phpstorm里設(shè)置斷點(diǎn),但是,是使用監(jiān)聽的模式。
具體可以參考這篇如何使用 PhpStorm 對 Laravel 除錯?,

鏈接引用自點(diǎn)燈坊
2017年2月17日 16:16
編輯回答
尛憇藌

我用PHPstorm 配置如下

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.2.100
xdebug.remote_port=9000
xdebug.idekey="PHPSTORM"

phpstorm 也需要設(shè)置 端口對應(yīng),瀏覽器 也需要裝插件xdebug helper

2018年5月9日 05:21