• 配置 Phpstorm + Xdebug + xampp


    配置 Phpstorm + Xdebug + xampp

    1 Xampp

    安装好xampp,配置 httpd.conf
    在xampp面板中
    单击后会出现一些配置文件,httpd.conf位于第一个
    将DocumentRoot 路径改为 "G:/PHP"  (我的工作空间),以后项目就放在这个目录里。
     
    配置 php.ini(打开方式如上)
     
    在Windows 下的配置:(这些代码位于php.ini的最后,将原来的带;的代码覆盖成以下所提供的就能够,此时执行phpinfo()函数能够看到在配置中有Xdebug)
    [XDebug]
    zend_extension = "D:XAMPPphpextphp_xdebug.dll"
    xdebug.profiler_append = 0
    xdebug.profiler_enable = 0
    xdebug.profiler_enable_trigger = 0
    xdebug.profiler_output_dir = "D:XAMPP mp"
    xdebug.profiler_output_name = "cachegrind.out.%t-%s"
    xdebug.remote_enable = 0
    xdebug.remote_handler = "dbgp"
    xdebug.remote_port=9000
    xdebug.remote_host = "127.0.0.1"
    xdebug.trace_output_dir = "D:XAMPP mp"
    xdebug.idekey= PHPSTROM

    上述配置中若开启profiler_enable的话本地訪问会变非常慢。

    配置完后重新启动apache ,查看phpinfo信息会看到xdebug已经开启了。若没有请查看xdebug.dll 和自己的php版本号是否相符合。

    2.在chrome页面的扩展程序中加入xdebug helper。


    3 PhpStorm设置
     
    在File->settings中

     
     



    如图所看到的配置setting中的4个地方,最后在图片所看到的的localhost位置单击(若没有在这里配置过。那么会没有内容显示)

    单击editconfiguration,能够看到例如以下所看到的

    单击左上角+符号。选择PHP Built-in Web Server,按如图所看到的配置,Document root 指你想执行项目的根文件夹。

    右側的port能够填写8789等4位数。


    如今就能够执行你的程序啦。如在网址中打,localhost:8789/index.php(如果你的根文件夹下的index.php是你的项目的入口)。

    4.要调试的时候打开phpstorm中右上角的监听。例如以下图所看到的。打开会变绿色。



    5.chrome右上角的xdebug图标。单击debug。图案会变绿。



    6.此时在你的代码中将你想要调试的代码的行号处设置断点。执行断点相关代码。调试就会进行.编辑器下方会出现调试信息。

  • 相关阅读:
    Redis-安装
    Redis-介绍
    Redis 教程(转)
    C# Redis 帮助类
    sublime text3---Emmet:HTML/CSS代码快速编写神器
    Sublime Text3 Package Control和Emmet插件安装方法
    vs2010音频文件压缩 调用lame_enc.dll将WAV格式转换成MP3
    vs学习过程中遇见的各种问题
    vs2010中添加dll文件
    解决angular11打包报错Type 'Event' is missing the following properties from type 'any[]': ...Type 'Event' is not assignable to type 'string'
  • 原文地址:https://www.cnblogs.com/yutingliuyl/p/6908419.html
Copyright © 2020-2023  润新知