最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

詳解關(guān)于php的xdebug配置(編輯器vscode)

 更新時間:2019年01月29日 10:31:48   作者:元谷  
這篇文章主要介紹了詳解關(guān)于php的xdebug配置(編輯器vscode),小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

雖然說echo和print_r是公認的最實用的調(diào)試工具,但是效率真的沒有可視化的直接斷點那么高。這里簡單介紹如果安裝及配置xdebug for vscode

一、PHP環(huán)境處的配置

1、編譯安裝

下載及編譯php,因為我所在的公司php版本是5.4的,所以去xdebug官網(wǎng)上選了相對比較底的版本.您也可以根據(jù)你們的實際情況下載相應的xdebug版本:https://xdebug.org/download.php

wget https://xdebug.org/files/xdebug-2.4.1.tgz
tar -xvf xdebug-2.4.1.tgz
cd xdebug-2.4.1/
phpize
./configure
make install

make最終結(jié)束輸出:

make install最終結(jié)束輸出:

2、配置php.ini文件

這個是我的配置。為了使得可配性更強。我將xdebug配置寫到:/etc/php.d/xdebug.ini

[Xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"  #這里改成你在make install后的路徑。
xdebug.remote_enable  = true
xdebug.remote_host   = 10.0.5.176   #改成你的vscode所以機器的ip地址
#default port 9000
xdebug.remote_port   = 9000  #如果9000端口沖突了,可以換一個。不過相應的vscode配置也要相應的改變
xdebug.profiler_enable  = on
xdebug.auto_trace   = On
xdebug.show_exception_trace = On
xdebug.remote_autostart  = On
xdebug.collect_vars   = On
xdebug.collect_return  = On
xdebug.remote_handler  =dbgp
xdebug.max_nesting_level = 10000
xdebug.trace_output_dir = "D:/code/videochat"  #我這里寫的是php代碼所在的路徑

二、配置vscode

1、使用vscode打開php工程后。安裝php-debug及生成調(diào)試配置文件,如圖所示,依次點擊這些按鈕

2、如下操作后,會出現(xiàn)如下選項框。選中php即可

3、選中后,會出現(xiàn)一個json的配置文件

修改此json文件,注意serverSourceRoot改成你服務器上,php所在的路徑。不然即使斷下來后,會出現(xiàn)找不到文件的異常

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9000,
      "stopOnEntry":false,
      "localSourceRoot": "${workspaceRoot}",
      "serverSourceRoot": "/work/videochat"
    },
    {
      "name": "Launch currently open script",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "port": 9000
    }
  ]
}

最后,在vscode里斷點好后。按F5,等待請求,即可享受圖形化的調(diào)試樂趣

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

潮安县| 侯马市| 铁岭市| 濮阳县| 隆化县| 新蔡县| 娄烦县| 临朐县| 五莲县| 甘谷县| 灵璧县| 得荣县| 宜良县| 丹巴县| 卢氏县| 通江县| 年辖:市辖区| 万荣县| 成武县| 青神县| 新乐市| 珲春市| 江山市| 嘉义县| 托克逊县| 天镇县| 延安市| 宽甸| 彭水| 汽车| 中卫市| 银川市| 芒康县| 岳池县| 本溪市| 德保县| 恩施市| 泰州市| 浪卡子县| 得荣县| 娱乐|