phpstorm xdebug 配置

xdebug方便了調試代碼,比起一個一個地方的打印結果仍是debug看的更明白下面介紹下maxOS系統下的debug配置

  1. 下載
     https://xdebug.org/download.php

    點擊紅線部分進入,粘貼phpinfo()信息推薦適合的下載版本
  2. 編譯安裝

    tar命令解壓進入下載好的xdebug目錄執行php

    phpize
    ./configure --with-php-config=/bin/php-config
    make && make install

     

  3. php.ini xdebug配置
    zend_extension=xdebug.so
    xdebug.remote_enable = On
    xdebug.remote_handler = dbgp
    xdebug.remote_host= localhost
    xdebug.remote_port = 9100
    xdebug.idekey = PHPSTORM
    xdebug.remote_connect_back = 1

    配置成功後phpinfo輸出以下信息nginx

     

  4. phpstorm配置

    preferences->Languages&Frameworks->PHP->Debugbash

    preferences->Languages&Frameworks->PHP->Debug->DBGp Proxyphpstorm

  5. 運行調試

    運行前須要配置 因爲nginx配置的項目運行端口爲8082這裏使用8082ide

相關文章
相關標籤/搜索