PhpStorm 断点调试

一、准备工作

  1. 安装 php7.0
  2. 安装 phpstorm
  3. 安装 xdebug2.4
  4. 安装 chrome 插件

二、Web 工程创建

  1. 添加 php 引擎
  2. 添加 web 访问端口

php 引擎配置:phpStorm -> settings -> Languages & Frameworks -> PHP

PHP language level CLI Interpreter Name PHP executable
7.0 Add Other Local PHP 7.0 /usr/bin/php

web 访问端口配置:phpStorm -> settings -> Languages & Frameworks -> PHP -> Servers

Name Host Port Debugger
PhpStorm 2018.1.7 PhpStorm 2018.1.7 63342 Xdebug

三、Web 断点调试

  1. 修改 xdebug 配置
  2. 修改 phpstorm 配置
  3. 启动 chrome 插件

xdebug 配置:vi /etc/php/7.0/mods-available/xdebug.ini

zend_extension=xdebug.so
xdebug.idekey="PHPSTORM"
xdebug.profiler_enable=1     
xdebug.profiler_output_dir="/tmp/xdebug"
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_host="localhost"
xdebug.trace_output_dir="/tmp/xdebug"

phpstorm 配置:phpStorm -> settings -> Languages & Frameworks -> PHP -> Debug

Xdebug Debug port DBGp Proxy Port
全选 9000 9001
posted @ 2020-08-10 17:39  小z同学  阅读(244)  评论(0编辑  收藏  举报