Your settings are those of xdebug v2, but it looks like you are using xdebug v3.
As mentioned by Derick in the comments there is an upgrade guide.
Still in my experience I mainly understand these manuals after I have got some configuration to work,
because this not only depends on xdebug, but also on the configuration of the IDE and on how you map
your server folders to your local project folders.
So let me show two working configurations, one with netbeans and one with vscode.
My setup is as follows:
my projectdir is mapped to the server as follows:
local: /`projectdir`/site/public
to server: /var/www/site/public (This is DocumentRoot in the apache configuration file)
index.php is located in /`projectdir`/site/public
Replace projectdir
with your projectdir.
On windows replace forward slashes with backslashes.
Use the right path for the zend_extension for your configuration.
configuration with netbeans
php.ini:
zend_extension=xdebug.so
xdebug.mode = debug
xdebug.discover_client_host = true
xdebug.idekey="netbeans-xdebug"
The debug configuration in netbeans (Tools > Options > PHP > Debugging):
Debugger Port: 9003
Session ID: netbeans-xdebug
(and maybe check Stop at First Line)
The project properties in netbeans(right-click on project > properties):
Sources: Project Folder: <project>
Source Folder: <project>
Web Root: site/public
Run Configuration: Project URL: <URL> (or hostname)
Index File: index.php
The default port of xdebug has changed to 9003; You can set it to 9000 with xdebug.client_port
in php.ini.
xdebug.discover_client_host
will try to connect to your IDE. If this does not work you could try to set the ip addres of the client with xdebug.client_host
wich replaces xdebug.remote_host
from version 2.
Obviously xdebug.idekey
must correspond with the Session ID of your netbeans configuration.
configuration with vscode
php.ini:
zend_extension=xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.discover_client_host = true
.vscode/launch.json (menu: Run > Add Configuration...)
{
// 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 3",
"type": "php",
"request": "launch",
"stopOnEntry": true,
"pathMappings": {
"/var/www": "${workspaceRoot}",
},
"port": 9003
},
{
"name": "Listen for XDebug 2",
"type": "php",
"request": "launch",
"stopOnEntry": true,
"pathMappings": {
"/var/www": "${workspaceRoot}",
},
"port": 9000
}
]
}