vagrant & centos & phpstorm & xdebug 调试

f!!!! 温馨提醒 PHP版本一点要和xdebug版本对应

 

###查看安装的xdebug  01
[root@localhost php.d]# yum list | grep xdebug

Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
php-composer-xdebug-handler.noarch         1.3.0-1.el7                epel      
php-pecl-xdebug.x86_64                     2.6.1-1.el7.remi.7.2       remi-php72
php54-php-pecl-xdebug.x86_64               2.4.1-1.el7.remi           remi-safe 
php55-php-pecl-xdebug.x86_64               2.5.5-1.el7.remi           remi-safe 
php56-php-pecl-xdebug.x86_64               2.5.5-1.el7.remi           remi-safe 
php70-php-pecl-xdebug.x86_64               2.6.1-1.el7.remi           remi-safe 
php71-php-pecl-xdebug.x86_64               2.6.1-1.el7.remi           remi-safe 
php72-php-pecl-xdebug.x86_64               2.6.1-1.el7.remi           remi-safe 
php73-php-pecl-xdebug.x86_64               2.7.0~beta1-1.el7.remi     remi-safe 

[root@localhost php.d]# yum install php-pecl-xdebug

###查看安装的xdebug  02
[root@localhost php.d]# ll /etc/php.d/  | grep xdebug
-rw-r--r--  1 root root 37784 Aug  4 05:54 15-xdebug.ini
[root@localhost php.d]# vim 15-xdebug.ini
    zend_extension=xdebug.so
    xdebug.idekey = "PHPSTORM"
    xdebug.default_enable = 1
    xdebug.remote_connect_back = 1
    xdebug.remote_port = 9001
    xdebug.remote_enable = 1
    xdebug.remote_autostart = 1
    xdebug.remote_handler="dbgp"


###查看安装的xdebug 03
[root@localhost php.d]# php -v
PHP 7.2.9 (cli) (built: Aug 15 2018 09:19:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans
    
###这里的配置不要写错了,remote_connect_back这项很重要
[root@localhost php.d]#  vim 15-xdebug.ini 
        zend_extension=xdebug.so
        xdebug.idekey = "PHPSTORM"
        xdebug.default_enable = 1
        xdebug.remote_connect_back = 1
        xdebug.remote_port = 9001
        xdebug.remote_enable = 1
        xdebug.remote_autostart = 1
        xdebug.remote_handler="dbgp"
        
        或者
        zend_extension=xdebug.so
        xdebug.idekey="PHPSTORM"
        xdebug.remote_connect_back = 1   //这项不要丢了
        xdebug.remote_handler = "dbgp"
        xdebug.remote_mode = "req"
        xdebug.remote_host=127.0.0.1
        xdebug.remote_enable=on
        xdebug.remote_port = 9001
        xdebug.remote_autostart = no

---------------虚拟机配置完毕------------------

 

windows中配置

04  Tools-->Vagrant 
05  Languages & Frameworks -->PHP--> Debug 
06  Languages & Frameworks -->PHP--> Debug --> DBGp Proxy
07  Languages & Frameworks -->PHP--> Servers

08 Run --> Edit Configurations  添加PHP Web Page
09接下来接可以断点调试了

 配图说明:

 

其他参考地址

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值