menu linbiwei
account_circle

正在努力加载中QAQ

phpstorm以及xdebug安装
date_range 2019-03-06 14:39
apps php
local_offer 查看标签
comment 1 条评论
浏览:551

phpstorm安装

首先安装PhpStorm
官方地址:https://www.jetbrains.com/phpstorm/
注册码可以在这里找:http://idea.lanyus.com/
或者https://3.jetbra.in/

xdebug安装

谷歌浏览器用Xdebug helper扩展 火狐浏览器用Xdebug-ext
下载xdebug
需要找到与PHP版本相配的xdebug ,也可通过https://xdebug.org/download.php 找到与PHP版本对应的xdebug
如果在这里不知道如何选择xdebug版本, 打开 https://xdebug.org/wizard.php 在浏览器访问phpinfo.php然后全选界面的内容拷到文本框里就可以得到相要的版本,注:不要把HTML源代码拷进去
将下载的php_xdebug.dll文件 拷贝到 php 安装路径ext文件夹下。
然后配置php.ini 注xdebug.remote_port端口必须与phpstorm配置的端口一致
以下是我的配置文件
注:谷歌浏览器装完xdebug helper后xdebug.remote_enable=1这个配置必须开启才可以使用
[XDebug]
;xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"
;xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"
;zend_extension="D:\phpStudy\php\php-5.6.27-nts\ext\php_xdebug.dll"
zend_extension = "D:\phpStudy\php\php-5.6.27-nts\ext\php_xdebug-2.5.5-5.6-vc11-nts.dll"
;允许远程IDE调试
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
;xdebug.remote_autostart = 1
xdebug.remote_enable=1
;远程IDE所在HOST和PORT
xdebug.remote_host=localhost
xdebug.remote_port=9003
xdebug.remote_handler=dbgp
;开启远程调试自动启动
;xdebug.remote_autostart = 1
;可以是任意Key,这里设定为PHPSTORM
xdebug.idekey = "PHPSTORM"
;xdebug.default_enable = 1
;开启自动跟踪
;xdebug.auto_trace = 1
;xdebug.show_exception_trace = 1
;xdebug.collect_vars = 1
;xdebug.collect_return = 1
;xdebug.collect_params = 1
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
;xdebug.trace_output_dir="D:\phpStudy\tmp\xdebug"
;把执行情况的分析文件写入到指定目录中
;xdebug.profiler_enable=on
;xdebug.profiler_output_dir="D:\phpStudy\tmp\xdebug"
;xdebug.var_display_max_children=128 
;xdebug.var_display_max_data=512     
;xdebug.var_display_max_depth=5  

编辑器设置

以下Host如果本地配置成虚拟域名则用虚拟域名
phpstorm以及xdebug安装

phpstorm以及xdebug安装

phpstorm以及xdebug安装

安装xdebug Helper

到谷歌商店
https://chrome.google.com/webstore/search/xdebug%20helper?utm_source=chrome-ntp-icon
搜索xdebug helper
装完后浏览器就会有个类似昆虫的图标鼠标右键选项然后配置
这里的key跟php配置文件还有编辑器配置的key保持一致

phpstorm以及xdebug安装
然后鼠标点击选绿色图标debug
phpstorm以及xdebug安装
最后就开启phpstorm这个类似电话的图标然后在左侧打断点就可以使用debug
phpstorm以及xdebug安装

汉化

可参考https://segmentfault.com/a/1190000041525269
名称不能为空
email
邮箱不能为空,请填写正确格式
link
网址请用http://或https://开头
message
评论不能为空
支持Markdown和LaTex数学公式
sentiment_very_satisfied

captcha
请输入验证码

    afeter afeter
    afeter
    August 7th, 2019 at 04:10 pmafeter
    keyboard_arrow_down
    August 7th, 2019 at 04:10 pm

    完美

    remove_red_eye
    访客
keyboard_arrow_up