首页 > 编程知识 正文

包含phpstorm之断点调试的词条

时间:2023-12-24 12:05:19 阅读:320057 作者:LBWT

本文目录一览:

phpstorm怎么运行php断点调试

运行环境:

PHPSTORM版本 : 8.0.1

PHP版本 : 5.6.2

xdebug版本:php_xdebug-2.2.5-5.6-vc11-x86_64.dll

ps : php版本和xdebug版本一定要相对应

1. PHP安装xdebug扩展

php.ini的配置,下面的配置仅供参考,路径要换成自己的!

[xdebug]

zend_extension="D:wampphp-5.6.2-x64extphp_xdebug-2.2.5-5.6-vc11-x86_64.dll"

xdebug.remote_enable = On

xdebug.remote_handler = dbgp

xdebug.remote_host= localhost

xdebug.remote_port = 9000

xdebug.idekey = PHPSTORM

ps : remote_handler 、remote_host、remote_port 这些都有默认值,但还是建议设置下,至少知道要设置这些参数~

查看phpinfo~

2.PHPSTORM设置

以前一直用zendstudio,刚开始用phpstorm非常蛋疼,用了一段时间后发现还挺好用的

1.首先检查phpstorm的xdebug配置

这里的debug port要和php.ini里面的xdebug.remote_port相一致!默认是9000,如果9000端口被占用的话,可以改成其他端口。

2. 设置debug.

添加本地的 web server~

www****com 是我本地的 web server~ ~

3.开始调试

打好第一个断点,shift + F9就可以了

打好第一个断点,选中配置的debug, 按旁边的臭虫 按钮

phpstorm怎么断点调试下一步

1.为php安装xdebug,方法在上一篇中有详细介绍

2.注意这个时候需要修改php.ini内容如下:

[Xdebug]

zend_extension_ts ="d:/wamp/php/ext/php_xdebug-2.1.2-5.2-vc6.dll"

xdebug.auto_trace=On

xdebug.collect_params=On

xdebug.collect_return=On

xdebug.trace_output_dir="d:/wamp/php/debuginfo"

xdebug.profiler_enable=On

xdebug.profiler_output_dir="d:/wamp/php/debuginfo"

xdebug.idekey=PhpStorm

xdebug.remote_enable=on

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.remote_handler=dbgp

3.phpstorm配置

客户端调试,打开phpStorm,进入FileSettingsPHPServers,这里要填写服务器端的相关信息,name填localhost,host填localhost,port填80,debugger选XDebug

进入FileSettingsPHPDebug,看到XDebug选项卡,port填9000,其他默认

进入FileSettingsPHPDebugDBGp Proxy,IDE key 填 phpStorm,host 填localhost,port 填80

点OK退出设置。

4.浏览器设置

chrome有插件xdebug helper下载后,设置白名单为localhost也就是默认localhost,才显示小虫子的图标

5.启动断点:

在phpstorm中设置断点后,启动监听,就是电话一样的图标,然后用chrome浏览localhost中的指定断点的文件,会自动进入断点,在phpstorm中看到调试信息。

phpstorm 10.0.4怎样断点调试

在php.ini中添加如下行:

zend_extension=”/wherever/you/put/it/xdebug.so”

xdebug.idekey=”PHPSTORM”

xdebug.remote_host=127.0.0.1

;默认是9000,但在此把端口设置为9001,因为如果和fpm冲突的话就无法启动,所以要修改一下

xdebug.remote_port=9001

xdebug.remote_enable=on

重启web服务器查看phpinfo()的信息就可确认xdebug是否开启成功。

为什么phpstorm设置断点这么麻烦,还要安装?

php设置断点不麻烦,只要php已经安装了xdebug扩展之后 ,在phpstorm中,只要配置调试端口和起始就可以了。

phpstorm怎么使用断点调试

工具/原料

phpstorm

Xdebug

方法/步骤

1

PHP安装xdebug扩展

2

phpstorm的xdebug配置

debug port要和php.ini里面的xdebug.remote_port相一致!默认是9000,如果9000端口被占用的话,可以改成其他端口。

3

添加php web appaliation

4

填写各项配置

5

打好第一个断点,shift + F9就可以了

打好第一个断点,选中配置的debug, 按旁边的debug虫子 按钮

END

注意事项

php.ini中信息要配置正确

如果9000端口被占用的话,可以改成其他端口。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。