900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > 本地环境phpStorm10+XDebug配置和断点调试

本地环境phpStorm10+XDebug配置和断点调试

时间:2022-04-05 18:17:22

相关推荐

本地环境phpStorm10+XDebug配置和断点调试

后端开发|php教程

本地环境phpStorm10+XDebug配置和断点调试

后端开发-php教程

本地环境phpStorm+XDebug+chrome配置和断点调试

百家cms源码,vscode 闪退没有堆栈,ubuntu安装wacom,设置tomcat电脑启动,基线检查爬虫,燕十八php全套视频,seo网站优化什么意思,帝国cms的网站模板修改,网站开发模板lzw

安装环境:XAMPP;phpStorm版本10; windows 7 64bit。

跑得快app源码,vscode补全属性,ubuntu 垃圾桶,png tomcat,连接sqlite 测试,国内服务器一定要备案吗,jquery 动画 插件,前端ui框架总结,爬虫代码怎么运行,php后面,SEO屈兴东,淘宝客单页网站怎么做,简单网页制作实例代码,日历网页模板,html页面进度条,会议室管理系统,e语言 子程序返回值lzw

XAMPP、phpStorm 都直接安装在了D盘根目录,9999m目录建在D:\xampp\htocts下,即目录工程文件夹路径为D:\xampp\htocts\9999m。在phpStorm>File>open,找到9999m,点击确定,加载9999m到了phpStorm(安装环境路径根据需要自行更改,后面的配置内容也类似)。图1

医院网页html源码,ubuntu镜像有问题,网络爬虫设计实例,求php网页,怎么开启seolzw

1.开始服务器端配置:安装好XAMPP,停止apache服务(注意,如果直接退出XAMPP,是不会停止apache的)。

2.在安装目录下找到php.ini,类似于D:\xampp\php\php.ini,并打开。

3.找到被注释掉的项目(去掉前面的?)并按如下设置:

[XDebug]

==============原代码

xdebug.profiler_append = 0

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

xdebug.profiler_output_dir =”D:\phpStudy\tmp\xdebug”

xdebug.trace_output_dir =”D:\phpStudy\tmp\xdebug”

xdebug.profiler_output_name = “cache.out.%t-%s”

xdebug.remote_enable = 1

xdebug.remote_handler = “dbgp”

xdebug.remote_host = “127.0.0.1”

;zend_extension=”D:\phpStudy\php53n\ext\xdebug.dll”

==============改后

xdebug.profiler_append = 0

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

xdebug.profiler_output_dir =”D:\phpStudy\tmp\xdebug”

xdebug.trace_output_dir =”D:\phpStudy\tmp\xdebug”

xdebug.profiler_output_name = “cache.out.%t-%s”

xdebug.remote_enable = 1

xdebug.remote_handler = “dbgp”

xdebug.remote_host = “127.0.0.1”

zend_extension=”D:\phpStudy\php53n\ext\xdebug.dll”

xdebug.idekey= PHPSTROM

====================转载的

zend_extension = “D:\xampp\php\ext\php_xdebug.dll”

xdebug.profiler_append = 0

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

xdebug.profiler_output_dir = “D:\xampp\tmp”

xdebug.profiler_output_name = “cachegrind.out.%t-%s”

xdebug.remote_enable = on

xdebug.remote_handler = “dbgp”

xdebug.remote_host = “127.0.0.1”

xdebug.trace_output_dir = “D:\xampp\tmp”

xdebug.idekey= PHPSTROM

最初的设置是这样的:图2

;的意思是被注释掉了,所以要先去掉;号;

然后开启xdebug.remote_enable = on;

还要增加xdebug.idekey= PHPSTROM。

其中remote_host 是指调试客户端的地址,即IDE所在的IP,同理remote_port 是客户端的端口,这两项在远程调试的情况下注意修改,远程的时候最终改为:

[XDebug]

zend_extension = “D:\xampp\php\ext\php_xdebug.dll”

xdebug.profiler_append = 0

xdebug.profiler_enable = 1

xdebug.profiler_enable_trigger = 0

xdebug.profiler_output_dir = “D:\xampp\tmp”

xdebug.profiler_output_name = “cachegrind.out.%t-%s”

xdebug.remote_enable = 1

xdebug.remote_handler = “dbgp”

xdebug.remote_mode = “req”

xdebug.remote_port = 9000

4.保存文件,重新启动apache检查是否成功开启了xdebug服务。图3

一种方法为在CMD里输入D:\xampp\php\php.exe -m 看到XDebug,说明成功开启XDebug。图4

另一种方法为浏览器打开localhost,找到phpinfo点击打开配置情况,查找xdebug项,找到了说明xdebug配置成功。图5

至此,服务器端配置完毕。

5.下面是客户端调试。打开phpStorm,进入File>Settings>PHP(文件-设置-语言和框架-php),这里要interpreter浏览,填D:\xampp\php\php.exe,自动识别版本。图6

6.进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息,name填localhost,host填localhost,port填80,debugger选XDebug。图7

7.进入File>Settings>PHP>Debug,看到XDebug选项卡,port填9000,其他默认。图8

8.进入File>Settings>PHP>Debug>DBGp Proxy,IDE key 填 PHPSTORM,host 填localhost,port填9000,点OK退出设置。图9

9.进入Run> Debug configurations,点+号,Server选填localhost,start url填http://localhost/9999m, Browse 填chrome,点OK退出设置。图10

点OK退出设置之后,phpstorm运行按钮旁边自动填充localhost,且运行按钮由灰色被激活成为绿色。如果start url填的是http://localhost,没有填写9999m,则当点击phpstorm运行按钮,浏览器进入默认地址http://localhost,没办法直接访问http://localhost/9999m。图11

10. chrome浏览器链接配置。找到对应的插件,chrome的为phpstrom IDE Support chrome.crx,自己下载然后拖动文件到chrome设置>扩展程序。Chrome右上角增加了JB图标即为成功安装插件。图12

11. 在phpStorm里打开监听,就是一个电话一样的按钮,点击变为绿色,在程序代码点前点击,设置程序段点,点击绿色的debug爬虫按钮,chrome浏览器打开xdebug页,phpStorm出现debug窗口,并获取到variables值,即为看到下面的debug信息,说明成功配置。图13

转载于:/zhyl4669

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。