<OLD>Ref: https://gist.github.com/henryonsoftware/066d8282daaf8c2ae281ce010e3e5404
1. Download xdebug source code from https://github.com/xdebug/xdebug/releases
for example the xdebug 3.3.2 from https://github.com/xdebug/xdebug/archive/refs/tags/3.3.2.tar.gz
2. extract the downloaded file
satria@teddy:~$ cd Downloads/
satria@teddy:~/Downloads$ tar -xvzf xdebug-3.3.2.tar.gz
3. run ‘phpize’
satria@teddy:~/Downloads$ cd xdebug-3.3.2/
satria@teddy:~/Downloads/xdebug-3.3.2$ phpize
Configuring for:
PHP Api Version: 20210902
Zend Module Api No: 20210902
Zend Extension Api No: 420210902
configure.ac:165: warning: The macro `AC_PROG_LIBTOOL’ is obsolete.
configure.ac:165: You should run autoupdate.
build/libtool.m4:99: AC_PROG_LIBTOOL is expanded from…
configure.ac:165: the top level
4. run ‘./configure’
satria@teddy:~/Downloads/xdebug-3.3.2$ ./configure
5. run ‘make’
satria@teddy:~/Downloads/xdebug-3.3.2$ make
6. copy the module xdebug.so to php lib 20210902
</OLD>
<NEW>
Use php from repository ppa:ondrej/php
then install php8.2-dev
[codesyntax lang=”php”]
|
1 2 3 |
sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php8.2-dev |
[/codesyntax]
then install php8.2-xdebug
[codesyntax lang=”php”]
|
1 |
satria@teddy:~$ sudo apt-get install php8.2-xdebug |
[/codesyntax]
check the php version
[codesyntax lang=”php”]
|
1 2 3 4 5 6 |
satria@teddy:~$ php -v PHP 8.2.25 (cli) (built: Oct 30 2024 11:25:56) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.25, Copyright (c) Zend Technologies with Zend OPcache v8.2.25, Copyright (c), by Zend Technologies with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans |
[/codesyntax]
if not php8.2, you can select it by using
[codesyntax lang=”php”]
|
1 |
satria@teddy:~$ sudo update-alternatives --config php |
[/codesyntax]
CONFIG XDEBUG
|
1 |
sudo gedit /etc/php/8.2/apache2/conf.d/20-xdebug.ini |
SETTING
|
1 2 3 4 5 6 |
zend_extension=xdebug.so xdebug.mode= debug xdebug.start_with_request = yes xdebug.var_display_max_data = 1024 xdebug.var_display_max_children = 512 xdebug.var_display_max_depth = 6 |