MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001066XdebugUsage problems (Wrong Results)public2014-07-15 17:292015-02-22 14:29
Reporterhandongwang 
Assigned Toderick 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLAMPOScentosOS Version6.3
Product Version2.2.5 
Target VersionFixed in Version2.3.0 
Summary0001066: E: Could not connect to client. :-(
Descriptionxdebugger log message shows
 
Log opened at 2014-07-15 15:29:40
I: Connecting to configured address/port: 127.0.0.1:9000.
E: Could not connect to client. :-(
Log closed at 2014-07-15 15:29:40

although I can telnet to 127.0.0.1:9000:

[handongw@torlx-handongw www]$ telnet -e p localhost 9000
Telnet escape character is 'p'.
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is 'p'.
p
 
telnet> quit
Connection closed.

PS: more details of my environement and configuration:

phpstorm 7.1.3, Drupal 7.28, Centos 6.3, PHP 5.4.30,
PHP 5.4.30 (cli) (built: Jun 25 2014 15:27:51)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

i installed xdebugger based on the customized installation instruction at http://xdebug.org/wizard.php [^]

I use xdegger help chrome extension to enable debugging. I tried jetbrain's bookmarklet too.

/etc/php.ini settings:
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_autostart=On
xdebug.idekey=PHPSTORM
xdebug.remote_log=/var/www/xdebug.remote.log
xdebug.profiler_output_dir = "/tmp/xdebug/"
xdebug.profiler_enable = Off
zend_extension = /usr/lib64/php/modules/xdebug.so

I tried port 10000 and it didnt work either.
Steps To ReproduceI followed the zero-configuration instructions in http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm?_ga=1.103683840.107492228.1404018833 [^] to debug drupal 7 module.

phpstorm starts listening at localhost:9000.
TagsNo tags attached.
Operating Systemcentos 6.3
PHP Version5.4.3
Attached Files

- Relationships

-  Notes
(0002867)
handongwang (reporter)
2014-07-15 20:29

xdebug_com.c: status = connect(sockfd, (struct sockaddr*)&address, sizeof(address)); failed.

the errno is "Permission denied".
(0002868)
derick (administrator)
2014-07-15 20:47

I think this could be SELinux being in the way. Can you turn it off (temporarily) by running as root: echo 0 >/selinux/enforce

And then try debugging again? Could you also use strace? (I think you've already done that to get to "permission denied"). But having a full trace (strace -o /tmp/strace.log php ...) would be handy.
(0002869)
handongwang (reporter)
2014-07-15 20:50

the root cause is that Centos 6.3 does not allow httpd to make tcp connection by default.
I need to run sudo setsebool -P httpd_can_network_connect=1 to get it work!

still xdebugger should put more detailed messages should error happened.
(0002870)
derick (administrator)
2014-07-15 21:53

Yeah, I agree. As I can't reproduce this (no CentOS here), an strace log would be extremely helpful to add that warning.
(0002871)
handongwang (reporter)
2014-07-15 23:11

Derick: many thanks for your quick reply and provided us xdebugger!
(0002872)
derick (administrator)
2014-07-16 00:01

No problem. But I am really asking whether you please could provide an strace log showing exactly which error code you get back from connect(). Can you make one to help me?
(0002893)
derick (administrator)
2014-11-11 19:47

I can not reproduce this, and because of that I would *really* like an strace
of a request to see what all the internal codes are and whether I can see
it's different from another "permission denied".
(0002961)
derick (administrator)
2015-01-07 00:05

Ping?
(0002991)
derick (administrator)
2015-02-14 00:09

I've added an extra warning in the log file for 2.2.8 and 2.3dev.

- Issue History
Date Modified Username Field Change
2014-07-15 17:29 handongwang New Issue
2014-07-15 20:29 handongwang Note Added: 0002867
2014-07-15 20:47 derick Note Added: 0002868
2014-07-15 20:47 derick Assigned To => derick
2014-07-15 20:47 derick Status new => feedback
2014-07-15 20:50 handongwang Note Added: 0002869
2014-07-15 20:50 handongwang Status feedback => assigned
2014-07-15 21:53 derick Note Added: 0002870
2014-07-15 21:53 derick Status assigned => feedback
2014-07-15 23:11 handongwang Note Added: 0002871
2014-07-15 23:11 handongwang Status feedback => assigned
2014-07-16 00:01 derick Note Added: 0002872
2014-07-16 00:01 derick Status assigned => feedback
2014-11-11 19:47 derick Note Added: 0002893
2015-01-07 00:05 derick Note Added: 0002961
2015-02-14 00:09 derick Note Added: 0002991
2015-02-14 00:09 derick Status feedback => closed
2015-02-14 00:09 derick Resolution open => fixed
2015-02-14 00:09 derick Fixed in Version => 2.2.8
2015-02-22 14:29 derick Fixed in Version 2.2.8 => 2.3.0
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker