| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
To debug PHP tests in Ubuntu (assuming PHP 8.2 is the default) with Visual Studio Code:
Install Xdebug:
sudo apt install php8.2-dev
sudo pecl install xdebugEnable Xdebug:
php --ini # verify the INI file location
sudo su
echo 'zend_extension=/usr/lib/php/20220829/xdebug.so' >> /etc/php/8.2/cli/conf.d/99-xdebug.iniVerify that it is enabled:
$ php --version
PHP 8.2.16 (cli) (built: Mar 7 2024 08:55:56) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.16, Copyright (c) Zend Technologies
with Zend OPcache v8.2.16, Copyright (c), by Zend Technologies
with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick RethansActivate debugging by adding the following lines to /etc/php/8.2/cli/conf.d/99-xdebug.ini:
xdebug.mode = debug xdebug.start_with_request = yes
Open VS Code and install the PHP Debug extension.
Activate debugging according to instructions on the extension site.
Test debugging.
| Back | FazBrowse Home | New Git URL |