无法连接到PHPStorm中的xdebug [英] Can't connect to xdebug in PHPStorm

查看:142
本文介绍了无法连接到PHPStorm中的xdebug的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我觉得尽管我已经尝试了一切,但仍然无法让xdebug连接到phpstorm.我说它正在等待连接,然后当我使用get变量?XDEBUG_SESSION_START=PHPSTORM或chrome扩展名加载页面时,该消息会短暂更改为connected,然后再返回等待状态. 错误:

So I feel although I've tried everything and still can't get xdebug to connect to phpstorm. I says it waiting for a connection, then when I load the page, using either the get variable ?XDEBUG_SESSION_START=PHPSTORM or the chrome extension, the message briefly changes to connected, before going back to waiting. The error:

E:\xampp\apache\logs\xdebug.log的错误日志中,如下所示

In the error log at E:\xampp\apache\logs\xdebug.log is as follows

Log opened at 2016-03-29 16:35:40
I: Connecting to configured address/port: 12hitchinscouts.local:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///E:/Users/Roshan/PhpstormProjects/12hitchinscouts.org.uk/index.php" language="PHP" protocol_version="1.0" appid="4396" idekey="PHPSTORM"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>

<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="stopping" reason="ok"></response>

<- breakpoint_set -i 6 -t line -f file://E:/Users/Roshan/PhpstormProjects/12hitchinscouts.org.uk/index.php -n 8
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6"><error code="5"><message><![CDATA[command is not available]]></message></error></response>

Log closed at 2016-03-29 16:35:41

我当前的配置

我正在xampp和php5.6的Windows 7 Pro上使用Apache 2.4

My current config

I'm using Apache 2.4 on Windows 7 Pro with xampp and php5.6

php.ini

[XDebug]
zend_extension = "E:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "E:\xampp\tmp\xdebug"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.idekey = PHPSTORM
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "12hitchinscouts.local"
xdebug.remote_port= 9001
xdebug.remote_log= "E:\xampp\apache\logs\xdebug.log"
xdebug.trace_output_dir = "E:\xampp\tmp\xdebug"
xdebug.extended_info  = 1

phpinfo

PHPStorm

  • 在PHPStorm中使用断点
  • 在PHPStorm中使用xdebug_break();
  • 在php.ini中将远程主机设置为此xdebug.remote_host = "127.0.0.1"
  • 各种教程和论坛帖子让我明白这一点
  • Using break-points in PHPStorm
  • Using xdebug_break(); in PHPStorm
  • Setting remote host to this xdebug.remote_host = "127.0.0.1" in php.ini
  • Various tutorials and forum posts to get me to this point

如果您需要更多信息,请随时提出,但我认为我已提供了所有内容.

If you need any more info then feel free to ask, but I think I've provided it all.

谢谢

哦,您到了底部:)

这是我的php文件:

<?php
//set page title
$title = "Welcome";
//for Facebook and twitter
$metaTitle = 'Looking to join Scouting or find out about our group?'; //title for post
$metaImage = 'http://12hitchinscouts.org.uk/images/FB-img.JPG'; //image url for post
$metaDesc = 'This is the official website for the 12th Hitchin scout group. Here you can find out about our different sections; when and where they meet as well as what they\'ll be doing next. This group consists of beavers cubs and scouts sections.'; //description to appear on post
$headMeta = '<!--for extra google results page features and SEO-->
    <script type="application/ld+json">
    {
       "@context": "http://schema.org",
       "@type": "Organization",
       "url": "https://12hitchinscouts.org.uk/",
       "logo": "http://12hitchinscouts.org.uk/images/12th-Logo.png",
       "name" : "12th Hitchin Scouts",
       "sameAs" : [ "http://www.facebook.com/groups/12hitchinscouts/",
        "http://www.twitter.com/12thhs" ],
       "potentialAction": {
         "@type": "SearchAction",
         "target": "https://12hitchinscouts.org.uk/search#stq={search_term_string}",
         "query-input": "required name=search_term_string"
       }
    }
    </script>
    <meta name="Description" content="This is the homepage for the 12th Hitchin scouts, from here you can find out what\'s going on and see upcoming activities for each section of our Hitchin scout group. Hitchin is our home too, and that\'s why we are commited to helping our local area aswell as other usual scouting activities.">'; //schema info for google
xdebug_break();
require("includes/head.php");
?>
<link href="css/index_response.css" rel="stylesheet" type="text/css">
<!--content-->
  <div class="fluid Title"><h1>Welcome!</h1></div>
    <br />
    <div class="fluid twitter hide_mobile ">
        <h2>Tweets
            <span class="follow">
                <a href="https://twitter.com/12thhs" target="_blank">
                <img src="images/Twitter_logo.gif" />
                Follow
                </a>
            </span>
        </h2>
        <br />
        <span class="tweets">
        <?php include_once("includes/twitter.php"); ?>
        </span>
    </div>
    <div class="fluid what">
        <h2>What is scouting?</h2>
        <p>Scouts was invented in 1907 by Robert Baden-Powell with just 20 boys. Over
a century later the number is into millions worldwide. There are many
stories around scouting, which could take up this entire pack – but suffice to
say it has evolved over the last century in many different ways.
We aim to ensure that a balanced programme is achieved which allows the
children to grow mentally, physically, socially and spiritually. Scouts
nowadays still need to Be Prepared as the old motto goes, and we have
many activities that are fun, testing and hopefully, a little bit out of the
ordinary – offering something new and different to everyone. We have tried
many activities over the last few years ranging from Bowling and archery to
bouldering and kayaking. We have walked in the peak district camping
overnight, conversely, we have walked for a couple of hours around
Deacon’s hill in Hitchin.</p>
<p>All the scout basics are there, including hiking, camping, first aid and
numerous badges catering from hobbies and activities to in depth levelled
badges for swimming or aeronautics! We also aim to complete a Challenge
Badge every 1-2 terms, which when collected gains the Chief Scouts Gold
award – the highest accolade available as a Scout. To earn this, Scouts show
their creativity, outdoor skills, help the community, learn about faiths and
tolerance and ultimately – go on an expedition for a few days, planned and
carried out by themselves!</p>
<p>Joining the scouts will leave you in esteemed company as people such as
Kate Middleton, Major Tim Peake, David Beckham, Nelson Mandela, Barack Obama, Richard
Branson, Ross Kemp and our current Chief Scout Bear Grylls, have all been
involved in scouting.</p>
    </div>
    <div class="fluid index_events">
        <h2>Upcoming events</h2>
        <?php 
        $no = 1; //number of upcoming events to display, 0 or less shows 1. Non integers are rounded and values of 0 or less are turned to 1
        $index = 1; //this is the index page, leave blank for implementation on other pages. uses if($index == 1) logic
        $limit['years'] = 1;//how far into the future should it show events? Non integers are rounded and values of 0 or less are turned to 1
        //This shows events from all sections, to specify a section, a line must be added the SQL queries
        include("includes/upcoming_events.php");
        ?>
    </div>    
    <div class="fluid galery">
        <h2>Gallery</h2><p><a href="/gallery">Visit full gallery</a></p>
        <?php require("includes/gallery_embed.php"); ?>
   </div>
<!--end content-->
    <?php require("includes/footer.php"); ?>

我知道我拼错了gallery,我只是还没有解决它:)

I know I spelt gallery wrong, I just haven't gotten around to fixing it yet :)

xdebug日志

Log opened at 2016-03-29 18:21:04
I: Connecting to configured address/port: 127.0.0.1:9001.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///E:/Users/Roshan/PhpstormProjects/12hitchinscouts.org.uk/index.php" language="PHP" protocol_version="1.0" appid="11672" idekey="PHPSTORM"><engine version="2.2.5"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2014 by Derick Rethans]]></copyright></init>

<- feature_set -i 1 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>

<- feature_set -i 2 -n max_depth -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>

<- feature_set -i 3 -n max_children -v 100
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>

<- status -i 4
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="4" status="starting" reason="ok"></response>

<- step_into -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="5" status="stopping" reason="ok"></response>

<- breakpoint_set -i 6 -t line -f file://E:/Users/Roshan/PhpstormProjects/12hitchinscouts.org.uk/index.php -n 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="6"><error code="5"><message><![CDATA[command is not available]]></message></error></response>

Log closed at 2016-03-29 18:21:05

PHPStorm日志

PHPStorm log

发布 pastebin太长时间了

推荐答案

如@LazyOne在评论中所述,我需要将xdebug版本更新为

As stated by @LazyOne in the comments I needed to update my xdebug version to 2.3.2

LazyOne没有发布答案,所以我正在做,如果他们愿意,我会接受他们的.

这篇关于无法连接到PHPStorm中的xdebug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆