无法连接到PHPStorm中的xdebug

时间:2016-03-29 17:08:41

标签: php xampp localhost phpstorm xdebug

问题

所以我觉得虽然我已经尝试了所有东西但仍然无法让xdebug连接到phpstorm。我说它等待连接,然后当我加载页面时,使用get变量?XDEBUG_SESSION_START=PHPSTORM或chrome扩展名,消息会暂时更改为connected,然后再返回等待。 错误:PHPStorm error

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

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

我当前的配置

我在Windows 7 Pro上使用Apache 2.4和xampp以及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

phpinfo

phpinfo

PHPStorm

PHP debug settings

PHP server settings

Debug setting

enter image description here

我尝试了什么

  • 在PHPStorm中使用断点
  • 在PHPStorm中使用xdebug_break();
  • 在php.ini
  • 中将远程主机设置为此xdebug.remote_host = "127.0.0.1"
  • 各种教程和论坛帖子让我谈到这一点

如果您需要更多信息,请随时提问,但我我已经提供了所有信息。

由于

哇,你到底了:)

修改

这是我的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错了,我还没有解决它:)

编辑2

xdebug log

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日志

发布pastebin

的时间太长了

2 个答案:

答案 0 :(得分:0)

尝试使用这些设置,然后下载this dll文件。它适用于我:

[XDebug]
zend_extension = "E:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_host=localhost
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_port=9000

答案 1 :(得分:0)

正如@LazyOne在评论中所说,我需要将我的xdebug版本更新为2.3.2

LazyOne没有发表回答,所以我这样做,如果他们这样做,我会接受他们的。