您的位置:首頁技術文章
文章詳情頁

phpstorm斷點調試方法圖文詳解

瀏覽:191日期:2022-06-10 16:30:27

環境:win10+phpstorm2022+phpstudy8+lnmp

1、phpinfo(); 查看是否安裝xdebug,沒有走以下流程

2、phpstudy中切換不同版本php版本,有些版本不支持xdebug(如php8.0.2),有些已經自帶了(如php7.3.9)。已經自帶的只需要在php.ini中調用

php.ini 配置文檔

[Xdebug]zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.9nts/ext/php_xdebug.dllxdebug.idekey=phpstormxdebug.remote_enable = Onxdebug.remote_host=localhost;xdebug.remote_port 默認值為9000,這里需要跟phpstorm配置一致,下面有說明xdebug.remote_port=9000xdebug.remote_handler=dbgpxdebug.auto_trace = On

3、檢測當前php 版本應該下載什么xdebug.dll的工具,它會提示應該下載哪個php版本,以及安裝配置步驟:Xdebug: Support — Tailored Installation Instructions

4、配置phpstorm

5、配置chome

6、開始調試

刷新瀏覽器網頁,出現以下對勾,表示配置成功

按F7,程序會一步一步往下走,碰到函數的話,會跳轉到該函數。

按F8,在當前代碼頁一行一行的往下走,碰到函數不會跳轉。

按F9,從某個斷點跳到另一行處斷點。

標簽: PHP
相關文章:
国产综合久久一区二区三区