Intereting Posts
Как различить пустую строку с нулевым размером в DOMDocument? как настроить Laravel mail.php для использования функции почты usuall? Ошибка Codeigniter «Не удается подключиться к серверу базы данных с помощью предоставленных настроек» доступ к данным сеанса доступа с помощью opencart через php-файл как установить id элемента с помощью PHP dom? Справка PHP Firebase – настройка JWT Как удалить теги HTML, CSS из строки? Что вызывает ошибку PDO Не удается выполнить запросы, в то время как другие небуферизованные запросы активны? не может перенаправлять форму на отправке Нет адаптеров по умолчанию в Zend, если я не добавлю их явно. Является ли это признаком или ошибкой? PHP / MySQL: получение нескольких столбцов с одинаковым именем в объединении запросов без псевдонимов? Поддерживает ли GWT php? Aptana 3 – Как удалить конечные пробелы при сохранении Географические координаты названия улиц Комментарий миграции Laravel 5.2 в столбце миграции

Не удается подключиться к xdebug в PHPStorm

Проблема

Поэтому я чувствую, хотя я все пробовал и до сих пор не могу получить xdebug для подключения к phpstorm. Я говорю, что он ждет подключения, а затем, когда я загружаю страницу, используя либо переменную get ?XDEBUG_SESSION_START=PHPSTORM либо расширение chrome, сообщение коротко меняется на connected , прежде чем возвращаться к ожиданию. Ошибка: Ошибка PHPStorm

В журнале ошибок в 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 

Моя текущая конфигурация

Я использую Apache 2.4 для Windows 7 Pro с 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

Настройки сервера PHP

Настройка отладки

введите описание изображения здесь

Что я пробовал

  • Использование точек останова в PHPStorm
  • Использование xdebug_break(); в PHPStorm
  • Установка удаленного хоста на этот xdebug.remote_host = "127.0.0.1" в php.ini
  • Различные учебники и сообщения на форуме, чтобы довести меня до этой точки

Если вам нужна дополнительная информация, тогда не стесняйтесь спрашивать, но я думаю, что все это предоставил.

благодаря

Whooo, вы достигли дна 🙂

редактировать

Вот мой 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"); ?> в <?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

Было слишком много времени, чтобы опубликовать пастебин

Попробуйте с этими настройками и загрузите этот 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 

Как заявил @LazyOne в комментариях, мне нужно было обновить версию xdebug до версии 2.3.2

LazyOne не отправил ответ, поэтому я делаю это, если они это сделают, я соглашусь с ними.