IDEA 调试Java 代码 and PhpStorm 调试PHP代码

作者: print("") 分类: 信息安全 发布时间: 2021-05-23 23:08

一、IDEA 调试Java 代码

1.1 新建Java web项目

如果没有Application Server 请添加 

点击run 启动项目

启动成功之后会默认打开浏览器

新建一个Servlet 打一个段点

然后按F7 就会一步步的往下走了

二、 PhpStorm 调试PHP代码

安装phpStudy 2016 其他版本都行

选择PHP扩展。然后安装Xdebug 扩展

然后打开php.ini

设置一下端口和key

[XDebug]
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir="C:\phpStudy\tmp\xdebug"

xdebug.trace_output_dir="C:\phpStudy\tmp\xdebug"


xdebug.profiler_output_name ="cache.out.%t-%s"

xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9001
xdebug.idekey = "PHPSTORM"

zend_extension="C:\phpStudy\php\php-5.6.27-nts\ext\php_xdebug.dll"

我这里设置的端口是9001 和key 是PHPSTORM

打开PhpStorm  进行设置  【PHP的版本就设置phpStudy运行的那个PHP版本。路径在phpStudy的安装目录

打开项目为web的根目录。然后进行设置

找到Debug 设置端口为9001 

设置KEy




设置成功之后,旁边会显示绿色的√

新建一个php进行调试

在phpinfo 哪里打一个段点,即可调试

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

您的电子邮箱地址不会被公开。