前言

需要的工具MxSrvsPHPStormXdebug helper

配置

MxSrvs

  1. 启动软件

    upload successful

  2. 打开配置编辑,编辑php.ini

    upload successful

  3. 配置Xdebug

    MxSrvs默认自带Xdebug,不需要去下载,配置如下图:

    upload successful

    [xdebug]
    zend_extension = "/Applications/MxSrvs/bin/php/ext/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_connect_back=1
    xdebug.var_display_max_depth = 512
    xdebug.profiler_append = 1
    xdebug.profiler_enable_trigger = 1
    xdebug.max_nesting_level = 200
    xdebug.profiler_output_dir = "/Applications/MxSrvs/logs/xdebug"
    xdebug.profiler_output_name = "cachegrind.out.%t.%p"
    xdebug.idekey='PHPSTORM'  # sessionkey
    xdebug.remote_port=9000   #
    
  4. 查看phpinfo信息

    upload successful

PHPStorm

设置PHPStorm的Xdebug端口,端口由xdebug.remote_port决定

upload successful

upload successful

Xdebug helper(Chrome插件)

  1. 在Chrome插件商店下载安装即可

    upload successful

  2. 配置Xdebug Helper

    IDE key由xdebug.idekey决定

    upload successful

测试

  1. 在网站根目录添加一个PHP文件

    upload successful

  2. 开启监听

    upload successful

  3. 开启Xdebug Helper

    upload successful

  4. 刷新网页,phpstorm会提示以下内容,同意即可:

    upload successful

  5. 提示Debug session was finished without being paused

    需要设置断点,然后刷新网页,就会显示如下界面。

    upload successful



web      php调试环境搭建

本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!