2

I have a server running CentOS7, PHP7.0.7 with php-fpm, and SELinux. I am trying to debug a PHP script running on that server. And I have a Mac machine that runs PHPstorm where I intend to do the debugging.

I followed this guide to Phpstorm.

Here's what I did:

1) installed xdebug to server

2) set xdebug config as follows:
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9099
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.idekey="PHPSTORM"

3) set ssh config to have: AllowTcpForwarding yes (I then reverted it as it did not help)

4) restarted php-fpm, sshd, and httpd

5) in my local terminal, open ssh connection to server with -R flag specified
$ ssh -R 9099:localhost:9099 user@host

6) Changed xdebug config in my phpstorm to listen to port 9099 and set a breakpoint in index.php

7) Opened website in my browser

But still my local xdebug does not stop at the breakpoint.

What could I be missing in this config?

Could it be SElinux that prevents debugging?

Vasily802
  • 121
  • 5

1 Answers1

1

old question, but im gonna leave this here nonetheless,
since it might at least help someone with troubleshooting

setsebool -P httpd_execmem 1

When enabled, this Boolean allows httpd to execute programs that require memory addresses that are both executable and writeable. Enabling this Boolean is not recommended from a security standpoint as it reduces protection against buffer overflows, however certain modules and applications (such as Java and Mono applications - and as i learned today, xdebug) require this privilege.

csminb
  • 111
  • 3