很久没在CSDN写东西了,但是今天实在忍不住了,在CSDN上看好多尼玛没讲清楚的帖子,搞得我配环境配好久,气死劳资了。
1.环境
phpstudy windows x86 8.1.1.3
phpstorm 2022.3
windows11
2.步骤
2.1 用phpstudy自带的扩展开启配置xdebug
2.2 修改php.ini
ok,我这里用的是php5.6.9的
拉到最下面,忘记改了哪些了,反正修改后就这样,host和port和dir这些会不同,我把时间设置的很长,避免debug的500錯誤
[Xdebug]
zend_extension=D:/phpstudy_pro/Extensions/php/php5.6.9nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=Off
xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.trace
xdebug.profiler_enable=Off
xdebug.profiler_output_dir=D:/phpstudy_pro/Extensions/php_log/php5.6.9nts.xdebug.profiler
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9007
xdebug.remote_handler=dbgp
xdebug.auto_trace=On
xdebug.remote_cookie_expire_time=3600
max_execution_time=3600
max_input_time=3600
default_socket_timeout = 3600
2.3 phpstorm設置
太多了,直接看图
###3.断点 开浏览器 测试
报错再去查,尽量看官方的错误文档