Showing posts with label Visual Studio Code. Show all posts
Showing posts with label Visual Studio Code. Show all posts

7/24/2020

PHP on Visual Studio Code

Ubuntu 20.04

Install XDebug
https://xdebug.org/docs/install

PHP Debug Adapter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

$ cd /etc/php/7.4/mods-available

$ gedit xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1

$ phpenmod xdebug

$ sudo service apache2 start

In Visual Studio Code, launch.json

{
"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,
"runtimeExecutable": "/usr/bin/php"
}
]
}