Connection was not established Xdebug 3 with PhpStorm timeout error - php

I need Xdebug to keep track of incoming data, where it goes, etc.
Since I run (raise up) the Drupal site using docksal, I set it up according to the instructions https://docs.docksal.io/tools/xdebug/#phpstorm
I wrote the command:
fin config set --env=local XDEBUG_ENABLED=1
And in the file docksal-local.env changed to:
XDEBUG_ENABLED="1"
I wrote the command:
fin project start
I checked Xdebug:
fin exec php-v | grep -i xdebug
And received:
with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans
I am running PHPUnit Kernel and Unir test, I put a breakpoint on some line.
I clicked the Start Listening for PHP Debug Connections button list.
I went to the site page in the browser, updated it and returned to PhpStorm but nothing happened. What do I need to do to make Xdebug work?
Getting this error :
[Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: 192.168.64.1:9000 (through xdebug.client_host/xdebug.client_port) :-(

Make sure your file looks like this:
php.ini :
[XDebug]
zend_extension = php_xdebug-3.1.5-vc15-x86_64.dll
xdebug.mode = debug,develop
xdebug.discover_client_host = yes
xdebug.log_level = 0
xdebug.log = "%sprogdir%/userdata/temp/xdebug/log.txt"
xdebug.start_with_request = yes
xdebug.idekey = VSCODE
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"env": {
"XDEBUG_CONFIG": "log_level=7",
}
}
]
}

Related

How to set up VSCode, PHP Debug and XDebug (Windows 10)

I want to use VSCode's 'PHP Debug' plugin with Xdebug to debug PHP scripts.
But when I choose "Debug|Start Debugging F5" the little debug pop-up appears and I am stuck. Buttons for Pause, Restart, Stop are active. Buttons for Step over, into, out are inactive (greyed out). Nothing happens in the debug console.
(1) VSCode 1.42.1 is installed
(2) XAMPP v3.2.4 is up and running
(3) Xdebug is installed using the wizzard and pasting my phpinfo() data to determine the correct version. When I start 'admin' from XAMPP Control Panel and review phpinfo, the browser shows me (amongst many other things):
[...]
This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.2, Copyright (c) 2002-2020, by Derick Rethans
[...]
(4) php.ini has
[XDEBUG]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.show_local_vars = 1
xdebug.remote_log = "C:\Program Files_\xampp\php\logs\xdebug.log"
zend_extension = "php_xdebug-2.9.2-7.4-vc15-x86_64.dll"
(please note that "Program Files_" is NOT the protected "Program Files" directory, XAMPP has write access as shown for point (9) below)
(5) the Windows path has C:\Program Files_\xampp\php; in it
(6) when I use Code Runner extension in VSCode to run a "Hello World.php" script is runs just fine
(7) launch.json for the VSCode debugger has
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000,
}
]
(8) my Windows firewall has an inbound rule to allow TCP traffic on port 9000.
(9) when I just run the code, xdebug.log (see php.ini) is updated with
[94396] Log opened at 2020-03-08 07:45:28
[94396] I: Connecting to configured address/port: localhost:9000.
[94396] E: Time-out connecting to client (Waited: 200 ms). :-(
[94396] Log closed at 2020-03-08 07:45:28
But when I use "Debug|Start Debugging F5" nothing happens in xdebug.log.
That is all the information that I thought relevant so far. Which leaves me like so:
me -> update_status("at wit's end")
Do you wizards out there have any idea where to dig? Which config file to tweak? Which log file to consult?
footnote: debugging of Python scripts in VSCode works just as expected.
#LazyOne's comment provided the clue and the tools to stumble upon the solution ...
And the answer turns out to be quite embarrassing.
Long story (how to check that VSCode is listening on port 9000)
start XAMPP, start VSCode
open your php script
set a breakpoint
open a Linux shell (I used Bash on Ubuntu on Windows)
run telnet 0.0.0.0 9000 or telnet localhost 9000 in the shell and observe the connection fail
root ~ $ telnet localhost 9000
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
root ~ $ telnet 0.0.0.0 9000
Trying 0.0.0.0...
telnet: Unable to connect to remote host: Connection refused
start debugging and see the frozen debug pop-up as described above
run telnet 0.0.0.0 9000 or telnet localhost 9000 in the shell and note the difference: you are connected to VScode!
root ~ $ telnet 0.0.0.0 9000
Trying 0.0.0.0...
Connected to 0.0.0.0.
Escape character is '^]'.
click the stop button on the frozen debug pop-up and observe in the shell
stop -i 1 Connection closed by foreign host.
root ~ $
Conclude that VSCode is indeed listening to both 0.0.0.0:9000 and localhost:9000.
scratch your head and go back to VSCode
start debugging
notice the orange status bar at the bottom that says "Listen to XDebug"
notice the drop down menu just below the menu bar that says "green arrow" and "Listen for XDebug"
explore the drop down and (re)discover the second configuration "Launch currently open script", realize/remember that your launch.json had 2 configurations
click the green arrow when "Launch currently open script" is selected, see a error pop up along the lines "listen EARDRINUSE: address already in use :::9000"
cancel the error message, stop debugging by clicking on the stop button of debug pop-up, notice that menu bar at the bottom turns blue
click the green arrow when "Launch currently open script" shows in the drop-down again ... and notice that debugging starts as expected
rejoice! praise #LazyOne for their help! thank the heavens for the stackoverflow community!
the "Listen for XDebug" configuration in launch.json is used to debug a script that was started from a browser session: (i) set your breakpoints in VSCode, (ii) start debugging with "Listen for XDebug" configuration, (iii) start the scripts by initiating a request i the browser, (iv) observe VSCode if a breakpoint is triggered while the request is processed
Short Story
Make sure that "Launch currently open script" is selected as configuration when you start debugging your php script in VSCode, see screenshot below.
Afterthought
I have changed my launch.json to
"configurations": [
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
},
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
}
]
This way the "Launch currently open script" is the default and will be used when I start debugging with "Debug|Start Debugging F5" from the main menu.
launch.json (default config):
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000,
}
]}
In php.ini is absolutely essential to include the directive xdebug.idkey=VSCODE, even though I haven't found any reference to it in the documentation.
[xDebug]
zend_extension="c:\xampp\php\ext\php_xdebug-2.9.8-7.3-vc15-x86_64.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.idekey=VSCODE
I just ran into this issue, where I was trying to listen to XDebug and nothing happened when I tried to hit F5 or Run/Debug...
It turns out some phantom folder had been added to my workspace (I had been running a bunch of test with some upgrade tool for the application I'm working on, so I guess that's where that came from?).
Removing that "extra" folder from the workspace was all I needed to do to be able to "run" the debug process again. Hopefully this can help someone else (not feel so dumb as I did) with a similar issue.

Able to debug ONLY when running test

Using laravel/homestead vagrant box, VS Code, and PHP Debug extension, I can set breakpoints and step through code only when running a test via phpunit.
If I access the same resource via the browser, my breakpoints are never hit.
Based on the fact that I can debug when tests are running, I'm assuming that xdebug is working and configured properly.
My .env file:
APP_NAME=lms
APP_ENV=local
APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
APP_DEBUG=true
APP_URL=https://lms.test
My .env.testing file:
APP_NAME=lms
APP_ENV=testing
APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
APP_DEBUG=true
APP_URL=https://lms.test
PHP Debug config:
"configurations": [
{
"name": "Listen for XDebug on Homestead",
"type": "php",
"request": "launch",
"pathMappings": {
"/home/vagrant/code/MyProject": "C:\\Users\\lemon\\source\\vagrant\\MyProject"
},
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
app.php
'env' => env('APP_ENV', 'production'),
'debug' => env('APP_DEBUG', false),
netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10
10.0.2.2
/etc/php/7.4/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_autostart=1
xdebug.remote_host=10.0.2.2
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512
I've enabled xdebug logging. When I run the debugger during a test, the log is created and shows the expected entries. If I then delete the log file and make a GET from the browser, to the same controller as the test, no xdebug log is created.
Maybe some fresh eyes can identify the problem. Thanks!
On the command line, the xdebug.remote_connect_back=1 setting has no effect. In a web environment, it instructs Xdebug to make an IDE connection to the IP address from the HTTP headers. But if there is a NAT network in the way, as with Docker often is the case, the IP address from the HTTP header can not be connected to by Xdebug and hence the debug connection can not be made.
When you remove the xdebug.remote_connect_back=1 setting, Xdebug exclusively uses the xdebug.remote_host setting, which you already had set correctly yourself (to 10.0.2.2).
When using Docker, you can almost never use xdebug.remote_connect_back.
In desperation I deleted these lines from 20-xdebug.ini (and restarted the php service) and it worked.
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512
No idea why, but I hope this helps someone else.

Visual Studio Code won't stop at breakpoint in PHP Xdebug

I have move from my Thinkpad laptop to HP Elitebook. I must set my development environment in my new laptop. After setup my Visual Studio Code and XAMPP in Windows 10 Pro 64 bit edition, I can't debug my PHP code.
I have properly installed Xdebug extension for Visual Studio Code, and make sure the php.ini correct. This is my setting for php.ini (I use portable XAMPP which is placed on E: drive):
zend_extension = "E:\xampp\php\ext\php_xdebug-2.4.1-5.4-vc9.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_log="E:\xampp\apache\logs\xdebug.log"
And my xdebug.log show information like this :
Log opened at 2018-10-27 05:56:45
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///E:/xampp/htdocs/absen/index.php" language="PHP" xdebug:language_version="5.4.3-dev" protocol_version="1.0" appid="7112" idekey="william"><engine version="2.4.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2016 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2018-10-27 05:56:45
But my Visual Studio Code won't stop at breakpoint.
I have reinstall my Visual Studio Code, XAMPP, and using another Xdebug version but it still doesn't work.
I have follow these links:
visual studio code PHP debugging not working
xdebug won't stop at breakpoint
xdebug breakpoint fail
Xdebug successfully connects to DBGP clients, but won't stop at breakpoints
None of these solutions work.
Finally i know the source of problem. The HP Elitebook have preinstalled program named HP Velocity, which used port 9000.
The issue is port 9000 from my host is bind to port 9000 of HP Velocity software. When HP Velocity service connect to the localhost xdebug server, logs say that connection is ok, but it is connected to HP Velocity.
I changed xdebug port to 9090 in php.ini and changed in launch.json on visual studio code. After that, my visual studio code work as usual and can stop at breakpoint.
Hope this help others :)
This is what fixed the same issue i was having,worth the shot if previous answers didn't help
php.ini
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-3.0.2-8.0-vs16-x86_64.dll"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.client_host = "127.0.0.1"
xdebug.log = "C:\xampp\tmp\xdebug\xdebug.log"
xdebug.idekey = VSCODE
launch.json
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"type": "php",
"request": "launch",
"name": "Run using local PHP Interpreter",
"program": "${file}",
"runtimeExecutable": "C:\\xampp\\php\\php.exe"
}
]
In my case, the pathMappings was incorrect, and did not change the port
{
...
"configurations": [
{
...
"port": 9000,
"pathMappings": {
"/var/www/yourproject": "${workspaceFolder}/",
}
}
]
}
My Breakpoints is actually working if I check the "Everything" breakpoint
(It captured a suppressed exception, but VS code alerted that the file was no found)
In my case, I was trying to debug a php script on my local machine, so I had to realize that I had to debug the php script using the port which the Web Server is using (8080 in my case) rather than using the port set on the VS Code configuration (I use 9090).
For anyone who is stuck with this error, this is my configuration:
OS: Windows 10 64 bits
PHP 5.6 (32 bits TS)
Xdebug 2.5.5 (32 bits)
Apache 2.4 (32 bits)
Xdebug Helper installed on Google Chrome
1) httpd.conf
2) php.ini (XDebug section)
3) launch.json (VS Code configuration)
The reason might caused by the port of php xdebug.It works for me fine when I did this:
1.use php --ini to show php config file and change xdebug port to 9900:
xdebug.remote_port=9900
then restart your php
2.open vscode and change the port to the same number in launch.json:
"port": 9900
3.enjoy your debug
I am a novice programmer so this will probably sound dumb, but might be helpful to someone new to PHP and web servers like me.
I had the same issue with Xdebug skipping a break point. For me it turned out to be that I had a break point on an "echo" statement. Apparently that is not a valid line for using a break point. It started working once I moved the break point to a variable declaration.
I had same issue but after change port to 8000 in ubuntu it works for me.
Please note if you are using Xdebug version 3.xx you need to do the following:
Stop Apache server, then in php.ini add at the end of the file:
[XDebug]
xdebug.mode = debug
zend_extension="C:\xampp\php\ext\php_xdebug.dll"
After that, start Apache server agian.
Note that adding xdebug.start_with_request = yes will tell xdebug to initialise communication with an IDE for every request even though you might not debugging, which gives a warning in your IDE console state:
[Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-(
It's better to use a chrome extension to trigger the activation of xdebug using a cookie in your browser. See https://xdebug.org/docs/step_debug#browser-extensions for more information.
In vscode go to Run in your top menu, then Add configuration, this will open launch.json, add under configurations:
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
Please note that port 9003 is different than your app port. I'm running my laravel app using: php artisan serve with port of 8000 and in my launch xdebug is 9003.
Re-run your debug in vscode and should be working.
I wish you the best in your bug-fighting war!
I saw the same issue, running ./vendor/bin/phpunit -c <config file> was causing all of my breakpoints to be disabled. I was only able to debug if I checked "Everything" and sorted through all the junk.
I updated the pathMappings in my launch.json file, and added a new launch configuration with a different pathMappings to work locally
{
"name": "PHP Unit Test XDebug",
"type": "php",
"request": "launch",
"port": 9001,
"log": true,
"externalConsole": false,
"pathMappings": {
"${workspaceFolder}": "${workspaceFolder}"
},
"ignore": []
},
I found this solution from this SO post, and this one here Debugging PHPUnit tests in VS Code?
Turns out the shell environment variable XDEBUG_MODE overrides the xdebug.mode setting in your php.ini, and I was setting the XDEBUG_MODE variable in my .zshrc file (likely a configuration from a previous project that I had long forgotten about).
In short, if xdebug isn't working and you've seemed to follow all of the instructions about setting up your IDE and php.ini file correctly, make sure you aren't inadvertently setting XDEBUG_MODE somewhere else.

Xdebug - Debug adapter process has terminated unexpectedly

I am using Visual Studio Code:
I have also installed the PHP Debug Extension Version 1.12.1. My PHP Version is:
>php --version
PHP 7.1.8 (cli) (built: Aug 1 2017 21:10:46) ( ZTS MSVC14 (Visual C++ 2015) x86 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
I have configured xdebug following the instructions on the PHP Debug plugin.
My settings inside my php.ini look like the following:
zend_extension = "C:\xampp\php\ext\php_xdebug-2.5.5-7.1-vc14.dll"
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.idekey = "whatever"
When running phpinfo(); my xdebug shows correctly:
My launch.json file looks the following:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
However, when running the configuration I get:
The error log looks like the following:
messageService.ts:126 Debug adapter process has terminated unexpectedly
e.doShow # messageService.ts:126
e.show # messageService.ts:105
_.onServerExit # rawDebugSession.ts:535
(anonymous) # rawDebugSession.ts:449
emitTwo # events.js:111
emit # events.js:194
__dirname.ChildProcess._handle.onexit # internal/child_process.js:215
Any suggestions what might be wrong with debugging?
I appreciate your replies!
Your vscode config looks fine (at least for pure-Windows PHP debugging). Your php.ini Xdebug config is unnecessarily filled with unimportant stuff (at least for debugging).
Get rid of the whole thing and try this minimal xdebug config:
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_connect_back = 1
xdebug.idekey = "whatever"
Then (if you use Chrome) you can use this extension to manage enabling/disabling debug sessions: Xdebug helper
Note: This is for debugging via browser - Chrome. I guess some equivalent plugin should exist for Firefox, but I haven't tried that. If you use Linux or WSL on Windows 10, you can enable debugging session by setting the proper environment variable like export XDEBUG_CONFIG="idekey=whatever" in Linux terminal. I suppose some equivalent exists with pure Windows command-line, but I haven't tried that, either.

Visual Studio Code - Xdebug won't work

In Visual Studio Code (1.9.1) (mac) i have setup the php-debug plugin.
In the debug screen i start 'listen for Xdebug'.
After this i open the index.php on my XAMPP server (local).
But nothing happens.
the blue bar at the bottom of the screen turns orange.
the step over, step into and step out buttons are greyed out.
Also the following error message occurs at the watched variables:
cannot evaluate code without an connection
I try to use breakpoints on the following code:
<?php
$i = 0;
do {
$i++;
if (!($i % 1)) {
echo('<p>$i = ' . $i . '</p>');
}
}
while ($i < 100);
?>
I am using XAMPP and in my php.ini file i use port 9000 for Xdebug.
zend_extension="/usr/local/Cellar/php71-xdebug/2.5.0/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote.port=9000
I installed Xdebug using homebrew.
Here is my php info:
phpinfo.htm
Xdebug wizard tells me Xdebug is installed correctly.
my launch.json file looks like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
Would anyone know what i am doing wrong?
After setting the xdebug.remote_connect_back = 1 in the ini file
as n00dl3 suggested debugging most of the time works, but once in a while i get the following
error in the debug console:
<- threadEvent
ThreadEvent {
seq: 0,
type: 'event',
event: 'thread',
body: { reason: 'exited', threadId: 1 } }
I encountered this problem as well, not with the same environment (NGINX server + php-fpm) but the same symptoms. It turned out to be caused by my xdebug configuration.
How I managed to diagnose it : by writing a simple PHP script for test just like OP did :
<?php
xdebug_info();
By browsing to it, I got a bunch of info on my setup, including :
xdebug.client_host => localhost
xdebug.client_port => 9003
whereas my xdebug was listening on port 9900 (default being 9000).
Steps to fix : just add the following lines to your php.ini or xdebug.ini (wherever the rest of your xdebug configuration lies) :
# This should match your xdebug.remote_host
xdebug.client_host=localhost
# This should match your xdebug.remote_port
xdebug.client_port=9900
xdebug.mode=debug
Then rerun a debug session in VScode, add some breakpoints, and re-browse to your script : my VScode window popped up, the execution was paused on the breakpoint and the variables where accessible in the debug pannel just like expected.
EDIT : don't forget to also :
add xdebug.mode=debug to your php.ini
restart webserver and php-fpm services.
It seemed the server root needed to be set
in the launch.json with localSourceRoot like this:
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true,
"localSourceRoot": "http://127.0.0.1/public_html/"
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
Now breakpoints are working like they should.
In my case, these two lines were missing from the php.ini file.
xdebug.mode = debug
xdebug.start_with_request = yes
Check xdebug.client_port
in page xdebug_info(); or phpinfo();
Config same port in launch.json of vscode
I just had this problem too.
Somehow, someday, without realizing it, I got version 3 of xdebug installed, and a lot of conf param name changed , see this SO question
So verifying the xdebug version with phpinfo for example can be worth a shot.
I am working with VSCODE devcontainer and I fix with the config below:
My launch.json for VSCODE
{
"version": "0.2.0",
"configurations": [
{
"name": "Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
}
I use Dockerfile with a RUN below to install xdebug:
RUN pecl install xdebug && docker-php-ext-enable xdebug
I find my xdebug config file in /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
I edit the file as below:
zend_extension=xdebug
[xdebug]
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
xdebug.idekey=VSCODE
Or you can add it in Dockfile like below:
RUN echo ' \n[xdebug] \n\
xdebug.client_host=host.docker.internal \n\
xdebug.mode=debug \n\
xdebug.start_with_request=yes \n\
xdebug.idekey="VSCODE" \n\
\n' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
mode This setting controls which Xdebug features are enabled. We’ve set develop to enable development aids, such as getting better error messages, and debug to enable step debugging.
client_host This setting tells Xdebug the IP address or hostname of the machine that is running your text editor or IDE.
start_with_request This setting determines whether a function trace, garbage collection statistics, profiling, or step debugging are activated at the start of a PHP request. Setting it to yes instructs Xdebug to always initiate a debugging session.

Categories