I have a development environment hosted on a linux cp using docker containers for the server and database. The server container includes apache2, php7 and xdebug. I have eclipse installed on the host computer. The server container is configured with xdebug having the following parameters:
xdebug.profiler_enable_trigger = 1
xdebug.trace_enable_trigger = 1
xdebug.remote_enable=1
;xdebug.remote_host="172.18.0.1"
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.profiler_output_dir="/var/www/ministerScheduling/clients/olmc1org/logs/"
I have tried using the remote host address which is exposed by phpinfo() when executed from a web browser on the host computer and using the remote_connect_back feature. Both behaved the same.
I have confirmed that xdebug can be remotely launched using the following code which shows that the connection is established when a page is requested with the following string appended to the url :
&XDEBUG_SESSION_START=mySession
Here is the script monitoring the connection:
$address = "127.0.0.1";
$port = 9000;
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
if ($sock === false) {
echo "Socket connection failed... ";
$lastError = socket_last_error();
echo socket_strerror($lastError);
} else {
echo "Socket connection made... ";
$bindResult = socket_bind($sock, $address, $port);
if ($bindResult) {
echo "Bind was successful... ";
$listenResult = socket_listen($sock);
if ($listenResult) {
echo "Socket is listening... ";
$client = socket_accept($sock);
if ($client === false) {
echo "Accept failed... ";
$lastError = socket_last_error();
echo socket_strerror($lastError);
} else {
echo "Connection accepted... ";
echo "connection established: $client";
socket_close($client);
}
} else {
echo "Listening failed... ";
$lastError = socket_last_error();
echo socket_strerror($lastError);
}
} else {
echo "Bind failed";
$lastError = socket_last_error();
echo socket_strerror($lastError);
}
socket_close($sock);
}
Yet eclipse will hot launch the debugger and when manually launched stops with the status showing Launching file.php (48%).
Help!!!