久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      圖文詳解PHPSTORM Xdebug的配置使用

      本篇文章給大家?guī)砹岁P(guān)于PHPSTORM Xdebug的相關(guān)知識(shí),其中主要介紹了phpstorm Xdebug是怎么配置使用的,下面一起來看一下,希望對(duì)需要的朋友有所幫助。

      寫在前面

      PHP 因?yàn)樘焐詭А盁峒虞d”的優(yōu)勢(shì),可能很多 phper 都很少使用 php 的 debug 功能吧。反正我已經(jīng)很久很久很久沒有用過 debug 了,回憶起來也該有5,6年了。。。

      但對(duì)于新手 phper 來說,沒有什么比 debug 更友好了。畢竟以前入門 php 的時(shí)候,它也是陪我走了不少歲月出了不少力,說是排坑解決問題的一大神器也不為過了。

      下面簡單記錄一下 phpstorm Xdebug 的配置使用,希望對(duì)你有所幫助!

      原理簡要

      圖文詳解PHPSTORM Xdebug的配置使用

      簡單 C/S 理解:一個(gè)客戶端(Client)、一個(gè)服務(wù)端(Server)

      檢查安裝

      檢查并安裝當(dāng)前 php 版本的 Xdebug 擴(kuò)展,php 擴(kuò)展安裝就不說了

      D:wwwoa2>php -m | find "Xdebug"Xdebug
      登錄后復(fù)制

      配置 php.ini debug 參數(shù)

      [XDebug]zend_extension="php_xdebug.dll"xdebug.idekey="PHPSTORM"xdebug.remote_enable =1xdebug.remote_handler =dbgp xdebug.remote_host =127.0.0.1xdebug.remote_port=9011xdebug.max_nesting_level=256xdebug.mode=debug,trace
      登錄后復(fù)制

      PHPSTORM 設(shè)置

      進(jìn)入phpstorm設(shè)置菜單(Ctrl+Alt+S),選擇 Languages & Frameworks => PHP, 設(shè)置 CLI Interpreters;

      圖文詳解PHPSTORM Xdebug的配置使用

      圖文詳解PHPSTORM Xdebug的配置使用

      選擇 PHP => Debug, 設(shè)置debug端口,同 php.ini 設(shè)置的 xdebug.remote_port=9011
      圖文詳解PHPSTORM Xdebug的配置使用

      當(dāng)前頁面點(diǎn)擊 Validate 按鈕,驗(yàn)證是否配置成功
      圖文詳解PHPSTORM Xdebug的配置使用

      選擇 PHP => Server, 配置server
      圖文詳解PHPSTORM Xdebug的配置使用

      設(shè)置 Debug Configurations
      圖文詳解PHPSTORM Xdebug的配置使用

      到這里就基本就ok了,最后寫個(gè) demo 開啟監(jiān)聽,編輯斷點(diǎn),來試試 debug 的效果吧
      圖文詳解PHPSTORM Xdebug的配置使用

      接口調(diào)試

      使用接口工具請(qǐng)求 API 時(shí)需添加參數(shù):XDEBUG_SESSION_START=TRUE
      如:laravel5.com/api/test?XDEBUG_SESSION_START=TRUE
      或者添加站點(diǎn)Cookie: XDEBUG_SESSION=TRUE;
      圖文詳解PHPSTORM Xdebug的配置使用

      瀏覽器調(diào)試請(qǐng)安裝 Xdebug helper 插件
      命令行的 debug 就更簡單了,實(shí)際就是配置一個(gè) php 運(yùn)行腳本
      如:生成一個(gè) artisan 測(cè)試腳本,打好斷點(diǎn),運(yùn)行 debug 即可
      圖文詳解PHPSTORM Xdebug的配置使用

      疑問

      如何配置遠(yuǎn)程debug呢?
      在上面的“設(shè)置 Debug Configurations”中,我選擇的是“PHP Web Page”。還可以選擇“PHP Remote Debug”,也支持本地 debug, 同時(shí)還支持遠(yuǎn)程 debug, 此選項(xiàng)需多配置一個(gè) IDE Key。
      遠(yuǎn)程 debug 其實(shí)是一樣的,稍微多一步配置:遠(yuǎn)程代碼與本地代碼的映射,僅此而已!
      圖文詳解PHPSTORM Xdebug的配置使用圖文詳解PHPSTORM Xdebug的配置使用

      因遠(yuǎn)程 debug 幾乎很少用到,就不詳細(xì)截圖了。有興趣的小伙伴可以自己試試,說不定哪天就用到了。。。

      推薦學(xué)習(xí):《phpstorm使用教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)