• 记录下zend studio 的xdebug 在调试安装


    没有单步调试 看不到变量的变化过程,是没法提高DEBUG效率的。折腾了好久终于把xdebug+zendstudio搞定了。虽然网上有教程,但实践起来

    还是碰到了些问题,在此记录下。

    1,安装zend stuido

         这里就不说这个了,必须的

    2,安装phpstudy

         主要是要安装php,apahce。没有本地服务器,怎么能调试呢。

    3,xdebug 安装

         在这里,我根据网上很多教程去下载了xdebug。但其实不需要,你装好了phpstudy就已经默认有了xdebug.dll.为什么不建议去网上再下载一次呢。

         因为下载过来的可能和php的版本不对应,这样是无法使用的。

        我的xdebug的路径:D:phpStudyphpphp-5.6.27-ntsext

    4,编辑php.ini

         php默认是不打开xdebug的所以要编辑这里。如果你用的php-5.6.27-nts,那一定要在编辑php-5.6.27-nts目录下的php.ini

         D:phpStudyphpphp-5.6.27-ntsphp.ini

      编辑如下:

    [XDebug]
    xdebug.profiler_output_dir="D:phpStudy mpxdebug"
    ;临时跟踪信息输出
    xdebug.trace_output_dir="D:phpStudy mpxdebug"
    zend_extension="D:phpStudyphpphp-5.6.27-ntsextphp_xdebug.dll"
    xdebug.profiler_append = 0
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 0
    xdebug.profiler_output_name = "cachegrind.out.%t-%s"
    ;收集参数
    xdebug.collect_params =1
    ;收集变量
    xdebug.collect_vars = 1
    ;收集返回值
    xdebug.collect_return =1
    ;开启自动跟踪
    xdebug.auto_trace = 1
    xdebug.remote_enable = 1
    xdebug.remote_handler = "dbgp"
    xdebug.remote_host = "127.0.0.1"
    xdebug.remote_port = 9000

    5,重启APACHE

       输入:127.0.0.1/phpinfo.php,如果看到下面这行。说明xdebug已经成功加载到php了。

      如果没看见,请确认亮点:1,你编辑的php.ini 是否是当前php允许所加载的

    确定你的xdebug路径是否正确。确定xdebug.dll 是phpstudy自带的。(我就是因为这个没有安装成功很多次)

    6,配置zend studio

    <1> 配置php executables

    windows->preferences->php executables->add

    设置默认执行

    <2> 配置php sever

          一定要先配置php server我就是因为没有先配置这个走了些冤枉路

    因为我用的aphache,所以

     server name随便填,配置文件选php的配置文件目录

     配置好,回到debug设置这里,弄成这样。就好了

     

     <7> 新建一个本地工程

    按F11,进入调试模式,已经可以看到变量了。

    按F8 可以单步到下一步

       

         

  • 相关阅读:
    2017 Multi-University Training Contest 2.Balala Power!(贪心)
    2017ICPCECIC C.A math problem(高次剩余)
    Atcoder 068E
    51nod 1385 凑数字(贪心+构造)
    cf round #418 div2 D. An overnight dance in discotheque(贪心)
    cf round #418 div2 C. An impassioned circulation of affection(暴力)
    cf round #424 div2 E. Cards Sorting(线段树)
    Atcoder 077E
    hdu 6162 Ch’s gift(树链剖分+主席树)
    Educational Codeforces Round 26 D. Round Subset(dp)
  • 原文地址:https://www.cnblogs.com/frankiephp/p/7106840.html
Copyright © 2020-2023  润新知