在做php代码审计时会用到的debug环境,需要的同学可以查看搭建一下
0x00 安装准备
phpstudy https://www.xp.cn/
phpstorm
xdebug https://xdebug.org/
0x01 配置过程
1、安装好phpstudy后需要打印phpinfo()内容并且将phpinfo()的html源码放在,https://xdebug.org/wizard 这个地址里面的表单里。点击 Analyse my phpinfo() output,会提示让你选择你当前php环境适合的xdebug版本
我这里选择php-7.1.13-nts,提交成功会出现以下的图
2、配置php.ini文件
[XDebug]
zend_extension="C:\php\phpstudy\PHPTutorial\php\php-7.1.13-nts\ext\php_xdebug64.dll"xdebug.auto_trace=onxdebug.collect_params=onxdebug.collect_return=onxdebug.trace_output_dir="C:\php\phpstudy\PHPTutorial\tmp\xdebug"xdebug.profiler_enable=onxdebug.profiler_output_dir="C:\php\phpstudy\PHPTutorial\tmp\xdebug"xdebug.remote_enable = onxdebug.remote_handler = dbgpxdebug.remote_host= localhostxdebug.remote_port = 9001xdebug.idekey = PHPSTORM
自己根据版本路径替换即可,配置完成后打印phpinfo()查看页面中是否有了xdebug如下
3、配置phpstrom
配置phpstorm一共有4个位置
首先打开设置--》选择语言和框架--》
4、Debug端口配置:
5、 IDEKEY配置
6、 Server配置
7、PHP Web Application配置
进入Run> Debug configurations,点+号选择PHP Web Page,Server选填localhost,Start URL填你要访问的页面(如:/index.php), Browser 默认或者选chrome
8、注意php.ini里面配置的内容是否和storm里面一样哈
发表评论