6

PHP环境下开启xdebug调试

 1 year ago
source link: https://fanygit.github.io/2022/11/16/PHP%E7%8E%AF%E5%A2%83%E4%B8%8B%E5%BC%80%E5%90%AFxdebug%E8%B0%83%E8%AF%95/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

PHP环境下开启xdebug调试

2022-11-16代码审计

阅读次数: 2

0

第一步:下载xdebug

先根据php版本去下载一个对应的php_xdebug.dll

https://xdebug.org/wizard

第二步:在php.ini中配置xdebug

php.ini中添加

[Xdebug]
zend_extension=E:/Tools/Env/phpstudy_pro/Extensions/php/php5.6.9nts/ext/php_xdebug.dll //dll路径
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=Off
xdebug.trace_output_dir=E:/Tools/Env/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir=E:/Tools/Env/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.profiler
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

使用phpstudy,可以将前两步代替掉

第三步:在phpstorm配置php和xdebug

然后在 phpstorm中,添加一个php的环境和xdebug扩展

添加一个PHP Built-in Web Server, 配置好 Server Configuration

运行,然后先访问一下 127.0.0.1:804

然后回到 phpstorm 中验证一下

这样表示成功

第四步:在火狐中安装xdebug扩展,并测试

接下来 在浏览器中安装 一个扩展

https://www.jetbrains.com/help/phpstorm/2021.1/browser-debugging-extensions.html

在主页下一个断点,并开启监听

访问一下,成功拦截到


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK