Domanda

The EC2 instance (with Ubuntu 12.04) has setup of Apache 2.4.6 and Php 5.5.6 + xDebug 2.2.2. Apache and PHP were built using make. Everything is working fine, except for xDebug.

Contents of log file and php.ini

php.ini

    zend_extension="/opt/php/lib/php/extensions/no-debug-zts-20121212/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.idekey=xdebug
    xdebug.remote_port=9000
    xdebug.remote_connect_back=1
    xdebug.remote_log="/tmp/xdebug_remote_log.log"
    xdebug.extended_info=1

/tmp/xdebug_remote_log.log

    Log opened at 2013-11-29 13:18:35
    I: Checking remote connect back address.
    I: Remote address found, connecting to 117.197.126.1:9000.
    E: Could not connect to client. :-(
    Log closed at 2013-11-29 13:18:36

I've exactly the same setup of Apache 2.4.6 and PHP 5.5.6 on a local CentOS 6.3 machine, that works just fine.

È stato utile?

Soluzione 2

It was my DLink Router preventing any inbound connection requests.

Setting up port-forwarding resolved this.

Note : Only set desired port(s) for inbound connections.

Altri suggerimenti

Depending on How you connect to the EC2 instance, you can have to open a Tunnel between your Computer and the EC2. This is specially the case if you can't redirect the port 9000 from the EC2 to your computer at work or at home (for any reason, like security, unable to open a port in the router etc... )

From your computer (OSX or Linux), open the SSH Tunnel:

ssh -N -R 9000:localhost:9000 ubuntu@domain_or_ip

Assuming you've already installed php5-xdebug, add these lines at the end of your php.ini:

xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000

And restart apache:

service apache2 restart

The port 9000 should be successfully redirected to netbeans (if you use Netbeans) or your editor which supports xdebug

Hope this can help somebody

Don't forget to restart:

sudo service httpd restart
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top