XAMPP + Phpstorm + Xdebug 实现断点调试

  1、开启XAMPP,使用ThinkPHP创建项目,添加PHP文件phpinfo.php, 写上phpinfo();

  2、使用Google浏览器地址栏输入:localhost/项目名称/public/phpinfo.php,可以看见php的信息,右键点击查看网页源码,CMD+A / CMD+C全部复制

  3、在这个网址下 https://xdebug.org/wizard.php 粘贴刚刚复制到信息,点击下方按钮,得到如下图PHP信息:

  

  4、按照官方提供 Instructions 中的步骤执行即可实现按照

  5、在/Applications/XAMPP/xamppfiles/etc/php.ini 文件中添加信息如下:

    [xdebug]
    zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
    xdebug.idekey="PHPSTORM"
    xdebug.remote_handler = "dbgp"
    xdebug.remote_mode = "req"
    xdebug.remote_host='localhost'
    xdebug.remote_enable=on
    xdebug.remote_port = 9000 //这是设置端口 可以改 只要下面这是phpstorm 一致就可以
    xdebug.remote_autostart = no

  CMD + S 保存退出  

  6、在Phpstorm配置如下: 

  A、配置php

  

 

  B、配置Debug

    

  C、添加Services

    

  D、添加调试项目

   

  

  

  E、运行

  

  

猜你喜欢

转载自www.cnblogs.com/PLA-Artillery/p/9131505.html