阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

PHP 设置调试工具XDebug PHPStorm IDE

152次阅读
没有评论

共计 925 个字符,预计需要花费 3 分钟才能阅读完成。

先下载 PHP 扩展 Xdebug https://xdebug.org, 可以复制自己的 phpinfo 粘贴到 https://xdebug.org/wizard.php 中, 会生成需要下载的版本, php.ini 的设置语句.

下载好之后放入 php 目录的 ext 文件夹中, 然后设置 php.ini, 在最后加上

zend_extension = C:\path\php\ext\php_xdebug-2.4.0rc4-5.6-vc11-x86_64.dll
xdebug.remote_enable =1
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_mode = req
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM

然后重启 apache, 去设置 phpstorm

PHP 设置调试工具 XDebug PHPStorm IDE

 

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

如果是自定域名则 host 设置自定域名, 如 laravel5.io

PHP 设置调试工具 XDebug PHPStorm IDE
2. 进入 File>Settings>PHP>Debug,找到 XDebug 选项卡,port 填 9000
进入 File>Settings>PHP>Debug>DBGp Proxy 填写:
IDE key: phpStorm
host: localhost
port: 80

PHP 设置调试工具 XDebug PHPStorm IDE

PHP 设置调试工具 XDebug PHPStorm IDE
设置完毕,点 OK 退出。

 

点菜单栏的 Run>Edit Configurations… 在弹出的窗口中添加一个调试配置:

点击左上角加号,选择 PHP Web Application

PHP 设置调试工具 XDebug PHPStorm IDE

填写完毕后,在代码里设置断点, 再开启电话 icno 监听, 点小甲壳虫启动调试

PHP 设置调试工具 XDebug PHPStorm IDE

PHP 设置调试工具 XDebug PHPStorm IDE

再下个浏览器插件, xdebug helper, 下载好之后点选项, IDE 选 PHPSTORM, 不想让所以网页显示小甲虫, 可以设置 domain filter

PHP 设置调试工具 XDebug PHPStorm IDE

基本完事了, 调试就点开电话图标监听, 设置好断点, 点小甲虫开启调试了, 刷新页面可见结果

PHP 设置调试工具 XDebug PHPStorm IDE

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-01/139311.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计925字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中