Bonjour,

configuration:
- ubuntu 22.04
- php 8.1
- IDE: VSCode

1 - J'ai suivi ce tuto pour installer Xdebug (j'aurais pas du)
https://php.tutorials24x7.com/blog/h...eans-on-ubuntu
J'ai donc utilisé une version compilée de Xdebug ce que propose Xdebug
2 - Par inadvertance, j'ai installé le paquet php-debug. Puis je l'ai désinstallé. J'ai du vider certains fichiers.
Voici mes configurations
php -v:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
gerard@gerard-ThinkCentre-M700:~$ php  -v
PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
    with Zend OPcache v8.1.2-1ubuntu2.14, Copyright (c), by Zend Technologies
gerard@gerard-ThinkCentre-M700:~$
php -i:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
gerard@gerard-ThinkCentre-M700:~$ php --ini
Configuration File (php.ini) Path: /etc/php/8.1/cli
Loaded Configuration File:         /etc/php/8.1/cli/php.ini
Scan for additional .ini files in: /etc/php/8.1/cli/conf.d
Additional .ini files parsed:      /etc/php/8.1/cli/conf.d/10-mysqlnd.ini,
/etc/php/8.1/cli/conf.d/10-opcache.ini,
/etc/php/8.1/cli/conf.d/10-pdo.ini,
....
/etc/php/8.1/cli/php.ini:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
[xdebug]
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port=9003
xdebug.log=/tmp/xdebug.log
/etc/php/8.1/apache2/conf.d/20-xdebug.ini :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
zend_extension=xdebug.so
xdebug.mode = develop, debug
xdebug.start_with_request = yes
xdebug.log = /tmp/xdebug.log
xdebug.client_host = "localhost"
xdebug.client_port = 9003
Jai hésité à utiliser le fichier /etc/php/8.1/apache2/php.ini
plutôt que /etc/php/8.1/apache2/conf.d/20-xdebug.ini (ci-dessus), mais Xdebug conseille ce fichier

Sur Vscode, j'ai installé PHP Debug installé launcj.json:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
    // 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": 9003
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}"
        }
    ]
}

Et voici le contenu de la page web de Xdebug:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Enabled Features
(through 'xdebug.mode' setting)
Feature	Enabled/Disabled	Docs
Development Helpers	✘ disabled	🖹
Coverage	✘ disabled	🖹
GC Stats	✘ disabled	🖹
Profiler	✘ disabled	🖹
Step Debugger	✔ enabled	🖹
Tracing	✘ disabled	🖹
Optional Features
Compressed File Support 	no
Clock Source 	clock_gettime
Diagnostic Log
No messages
Step Debugging	Docs
Debugger	Active	🖹
Connected Client	localhost:9003	 
DBGp Settings
Max Children	32	 
Max Data	1024	 
Max Depth	1	 
Show Hidden Properties	No	 
Extended Properties	No	 
Notifications	No	 
Resolved Breakpoints	No	 
Breakpoint Details	No	 
PHP
Build Configuration
Version (Run Time) 	8.1.2-1ubuntu2.14
Version (Compile Time) 	8.1.1
Debug Build 	no
Thread Safety 	disabled
Settings
Configuration File (php.ini) Path 	/etc/php/8.1/cli
Loaded Configuration File 	/etc/php/8.1/apache2/php.ini
Scan this dir for additional .ini files 	/etc/php/8.1/apache2/conf.d
Additional .ini files parsed 	/etc/php/8.1/apache2/conf.d/10-mysqlnd.ini, /etc/php/8.1/apache2/conf.d/10-opcache.ini, /etc/php/8.1/apache2/conf.d/10-pdo.ini, /etc/php/8.1/apache2/conf.d/15-xml.ini, /etc/php/8.1/apache2/conf.d/20-apcu.ini, /etc/php/8.1/apache2/conf.d/20-calendar.ini, /etc/php/8.1/apache2/conf.d/20-ctype.ini, /etc/php/8.1/apache2/conf.d/20-curl.ini, /etc/php/8.1/apache2/conf.d/20-dom.ini, /etc/php/8.1/apache2/conf.d/20-exif.ini, /etc/php/8.1/apache2/conf.d/20-ffi.ini, /etc/php/8.1/apache2/conf.d/20-fileinfo.ini, /etc/php/8.1/apache2/conf.d/20-ftp.ini, /etc/php/8.1/apache2/conf.d/20-gd.ini, /etc/php/8.1/apache2/conf.d/20-gettext.ini, /etc/php/8.1/apache2/conf.d/20-iconv.ini, /etc/php/8.1/apache2/conf.d/20-intl.ini, /etc/php/8.1/apache2/conf.d/20-mbstring.ini, /etc/php/8.1/apache2/conf.d/20-mysqli.ini, /etc/php/8.1/apache2/conf.d/20-pdo_mysql.ini, /etc/php/8.1/apache2/conf.d/20-pdo_sqlite.ini, /etc/php/8.1/apache2/conf.d/20-phar.ini, /etc/php/8.1/apache2/conf.d/20-posix.ini, /etc/php/8.1/apache2/conf.d/20-readline.ini, /etc/php/8.1/apache2/conf.d/20-shmop.ini, /etc/php/8.1/apache2/conf.d/20-simplexml.ini, /etc/php/8.1/apache2/conf.d/20-sockets.ini, /etc/php/8.1/apache2/conf.d/20-sqlite3.ini, /etc/php/8.1/apache2/conf.d/20-sysvmsg.ini, /etc/php/8.1/apache2/conf.d/20-sysvsem.ini, /etc/php/8.1/apache2/conf.d/20-sysvshm.ini, /etc/php/8.1/apache2/conf.d/20-tokenizer.ini, /etc/php/8.1/apache2/conf.d/20-xdebug.ini, /etc/php/8.1/apache2/conf.d/20-xmlreader.ini, /etc/php/8.1/apache2/conf.d/20-xmlwriter.ini, /etc/php/8.1/apache2/conf.d/20-xsl.ini, /etc/php/8.1/apache2/conf.d/20-zip.ini
Directive	Local Value	Master Value	Docs
xdebug.mode	debug	debug	🖹
xdebug.start_with_request	yes	yes	🖹
xdebug.start_upon_error	default	default	🖹
xdebug.output_dir	/tmp	/tmp	🖹
xdebug.use_compression	0	0	🖹
xdebug.trigger_value	no value	no value	🖹
xdebug.file_link_format	no value	no value	🖹
xdebug.filename_format	no value	no value	🖹
xdebug.log	/tmp/xdebug.log	/tmp/xdebug.log	🖹
xdebug.log_level	7	7	🖹
xdebug.var_display_max_children	128	128	🖹
xdebug.var_display_max_data	512	512	🖹
xdebug.var_display_max_depth	3	3	🖹
xdebug.max_nesting_level	256	256	🖹
xdebug.cli_color	0	0	🖹
xdebug.force_display_errors	Off	Off	🖹
xdebug.force_error_reporting	0	0	🖹
xdebug.halt_level	0	0	🖹
xdebug.max_stack_frames	-1	-1	🖹
xdebug.show_error_trace	Off	Off	🖹
xdebug.show_exception_trace	Off	Off	🖹
xdebug.show_local_vars	Off	Off	🖹
xdebug.dump.COOKIE	no value	no value	🖹
xdebug.dump.ENV	no value	no value	🖹
xdebug.dump.FILES	no value	no value	🖹
xdebug.dump.GET	no value	no value	🖹
xdebug.dump.POST	no value	no value	🖹
xdebug.dump.REQUEST	no value	no value	🖹
xdebug.dump.SERVER	no value	no value	🖹
xdebug.dump.SESSION	no value	no value	🖹
xdebug.dump_globals	On	On	🖹
xdebug.dump_once	On	On	🖹
xdebug.dump_undefined	Off	Off	🖹
xdebug.profiler_output_name	cachegrind.out.%p	cachegrind.out.%p	🖹
xdebug.profiler_append	Off	Off	🖹
xdebug.cloud_id	no value	no value	🖹
xdebug.client_host	localhost	localhost	🖹
xdebug.client_port	9003	9003	🖹
xdebug.discover_client_host	Off	Off	🖹
xdebug.client_discovery_header	no value	no value	🖹
xdebug.idekey	no value	no value	🖹
xdebug.connect_timeout_ms	200	200	🖹
xdebug.scream	Off	Off	🖹
xdebug.gc_stats_output_name	gcstats.%p	gcstats.%p	🖹
xdebug.trace_output_name	trace.%c	trace.%c	🖹
xdebug.trace_format	0	0	🖹
xdebug.trace_options	0	0	🖹
xdebug.collect_assignments	Off	Off	🖹
xdebug.collect_return	Off	Off	🖹