XDebug, VScode( VScodium ), Ubuntu
Inštalácia XDebug v Ubuntu a použitie s VScode alebo VScodium [ open source verzia bez telemetrie od Microsoftu ;) ]
1.
sudo apt install php-xdebug
2.
sudo nano /etc/php/7.4/mods-available/xdebug.ini
Na koniec súboru pridaj tieto riadky:
[xdebug]
zend_extension=/usr/lib/php/20190902/xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
Pre nájdenie cesty xdebug (/usr/lib/php/20190902/xdebug.so)
locate xdebug.so
3.
Otvor konfiguráčný súbor vo VScode
Pridaj:
{
"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
}
]
}
4.
php.ini
sudo nano /etc/php/7.4/apache2/php.ini
Na koniec suboru pridaj
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
5.
Reštartuj apache
sudo systemctl restart apache2