View Issue Details

IDProjectCategoryView StatusLast Update
0001066XdebugUncategorizedpublic2015-02-22 14:29
Reporterhandongwang Assigned Toderick  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformLAMPOScentosOS Version6.3
Product Version2.2.5 
Fixed in Version2.3.0 
Summary0001066: E: Could not connect to client. :-(
Description

xdebugger 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 Reproduce

I 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

Activities

handongwang

2014-07-15 19:29

reporter   ~0002867

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

the errno is "Permission denied".

derick

2014-07-15 19:47

administrator   ~0002868

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.

handongwang

2014-07-15 19:50

reporter   ~0002869

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.

derick

2014-07-15 20:53

administrator   ~0002870

Yeah, I agree. As I can't reproduce this (no CentOS here), an strace log would be extremely helpful to add that warning.

handongwang

2014-07-15 22:11

reporter   ~0002871

Derick: many thanks for your quick reply and provided us xdebugger!

derick

2014-07-15 23:01

administrator   ~0002872

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?

derick

2014-11-11 19:47

administrator   ~0002893

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".

derick

2015-01-07 00:05

administrator   ~0002961

Ping?

derick

2015-02-14 00:09

administrator   ~0002991

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 16:29 handongwang New Issue
2014-07-15 19:29 handongwang Note Added: 0002867
2014-07-15 19:47 derick Note Added: 0002868
2014-07-15 19:47 derick Assigned To => derick
2014-07-15 19:47 derick Status new => feedback
2014-07-15 19:50 handongwang Note Added: 0002869
2014-07-15 19:50 handongwang Status feedback => assigned
2014-07-15 20:53 derick Note Added: 0002870
2014-07-15 20:53 derick Status assigned => feedback
2014-07-15 22:11 handongwang Note Added: 0002871
2014-07-15 22:11 handongwang Status feedback => assigned
2014-07-15 23:01 derick Note Added: 0002872
2014-07-15 23: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 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized