zoukankan      html  css  js  c++  java
  • Mac 安装xdebug扩展

     下载

    https://pecl.php.net/get/xdebug-2.7.2.tgz

    解压

    tar -zxvf xdebug-2.7.2.tgz

    进入目录

    cd xdebug-2.7.2

    phpize

    /Applications/MAMP/bin/php/php7.3.1/bin/phpize

    configure

    ./configure     --with-php-config=/Applications/MAMP/bin/php/php7.3.1/bin/php-config --enable-xdebug 
    make && make install

    在php.ini中加入xdebug配置

    [xdebug]
    zend_extension="/Applications/MAMP/bin/php/php7.3.1/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_autostart = 1
    xdebug.idekey = PHPSTORM
    xdebug.remote_host=localhost
    xdebug.remote_handler = dbgp
    ;默认的9000已经被php-fpm占用了,切记换一个端口
    xdebug.remote_port=9001
    xdebug.remote_connect_back = 1
    xdebug.scream = 0
    xdebug.show_local_vars = 1

    重启环境,查看phpinfo 看是否已安装xdebug扩展。

    配置phpstorm

    phpstorm  -> perferences -> languages&frameworks ->  PHP -> debug

    启动phpstorm的调试debug

    启动成功后,打断点,访问项目,看是否调试成功。

    进行调试

      在需要调试的行上打上断点(点击一下行号后面的空白处即可,再点一次取消断点),需要说明的是当程序运行到该断点时,程序会停留在该行,但该行本身不会执行。自此可以查看程序运行到此处时所包含的所有数据信息。当然,查看信息功能相当于使用php中的var_dump。

  • 相关阅读:
    多表关联 update
    pdf转成图片
    JS中也可以使用JSTL和EL标签
    JSTL String时间转成 date
    SQL函数创建错误
    使用 itext、flying-saucer 实现html转PDF(转)
    Redis 命令参考
    1、课程介绍
    layui 弹出框提交表单
    一张图解析
  • 原文地址:https://www.cnblogs.com/mzhaox/p/11230930.html
Copyright © 2011-2022 走看看