Hayate
Hayate

Reputation: 693

remote debug with xdebug on centos 6.4

I try remote debug php application with phpstorm. I use centos 6.4, php5.3 and apache 2.2 on vmware virtual machine, and phpstorm with firefox on real ubuntu. xdebug is really installed:

Installed Packages
Name        : php-pecl-xdebug
Arch        : i686
Version     : 2.1.4
Release     : 1.el6
Size        : 580 k
Repo        : installed
From repo   : epel
Summary     : PECL package for debugging PHP scripts
URL         : http://pecl.php.net/package/xdebug
License     : PHP

And phpinfo confirm this too:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Xdebug v2.1.4, Copyright (c) 2002-2012, by Derick Rethans

When i run script (simple hello world) from console via ssh my script is stopped, i get connection to mu ide from xdebug and xdebug write info in own log. But when i run script from browsen - is has no effect, even in xdebug log. I try use firefox extension to start debug session, i try use xdebug.remote_autostart=1 option, tru turn off iptables in centos, but no effect too. What i do wrong? xdebug config:

; Enable xdebug extension module
zend_extension=/usr/lib/php/modules/xdebug.so
;xdebug.remote_host=10.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
;xdebug.profiler_enable=1
;xdebug.profiler_enable_trigger=1
;xdebug.remote_autostart=1
;xdebug.idekey=PHPSTORM
xdebug.remote_log="/tmp/xdebug.log"

Upvotes: 3

Views: 5186

Answers (2)

technocrusaders.com
technocrusaders.com

Reputation: 195

etc/selinux/config change

  • This file controls the state of SELinux on the system.

  • SELINUX= can take one of these three values:

  • enforcing - SELinux security policy is enforced.

  • permissive - SELinux prints warnings instead of enforcing.

  • disabled - No SELinux policy is loaded. SELINUX=enforcing

  • SELINUXTYPE= can take one of three two values:

  • targeted - Targeted processes are protected,

  • minimum - Modification of targeted policy. Only selected processes are protected.

  • mls - Multi Level Security protection.

SELINUXTYPE=targeted

to

  • This file controls the state of SELinux on the system.

  • SELINUX= can take one of these three values:

  • enforcing - SELinux security policy is enforced.

  • permissive - SELinux prints warnings instead of enforcing.

  • disabled - No SELinux policy is loaded.

SELINUX=disabled

  • SELINUXTYPE= can take one of three two values:

  • targeted - Targeted processes are protected,

  • minimum - Modification of targeted policy. Only selected processes are protected.

  • mls - Multi Level Security protection.

SELINUXTYPE=targeted

Upvotes: 0

Hayate
Hayate

Reputation: 693

Oh my god, problem solved. It's all selinux.

setsebool httpd_can_network_connect=1, nttpd restart - and phpstorm get connection from xdebug.

Upvotes: 6

Related Questions