Instalando PHP 7.4 com Nginx + XDebug 2 no Ubuntu 20.04 LTS
$ sudo apt install nginx php-fpm php-apcu php-zip php-mysql php-json php-mbstring php-intl php-tidy php-xdebug php-xml php-dev
$ sudo nano /etc/php/7.4/mods-available/xdebug.ini
zend_extension=xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_log = /var/log/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9001
xdebug.show_error_trace = 1
xdebug.remote_connect_back = 1
xdebug.max_nesting_level = 1000
Se você usa o VSCode utilize a seguinte configuração no launch.json:
{
// 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": 9001,
"stopOnEntry": false,
"hostname": "localhost",
"xdebugSettings": {
"max_data": -1
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9001
}
]
}
Comentários