Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Last active March 7, 2024 05:43
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save joseluisq/5a62fc629cbc2b93f89b9a3b6c2f4913 to your computer and use it in GitHub Desktop.
Save joseluisq/5a62fc629cbc2b93f89b9a3b6c2f4913 to your computer and use it in GitHub Desktop.
Install PHP 7 Xdebug in Arch Linux

Install PHP 7 Xdebug in Arch Linux

"Normally", these instructions should be also valid (in similar way) for other Linux distros.

1.- Install Xdebug using pacman:

sudo pacman -Sy xdebug

2.- Add or edit xdebug.ini file and add xdebug as Zend extension:

sudo emacs /etc/php/conf.d/xdebug.ini

add xdebug.so lines as follow:

zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.cli_color = 2

3.- Verify if the extension is loaded:

php -r "var_dump(extension_loaded('xdebug'));"

Command line code:1:
bool(true)

Source: https://wiki.archlinux.org/index.php/PHP#XDebug

@artemsites
Copy link

Thank you!

@WiRight
Copy link

WiRight commented Feb 4, 2019

Thx so much!

@jebog
Copy link

jebog commented Aug 3, 2019

Thanks

@menriquez
Copy link

thank you...working with php7.4

@jsvptf22
Copy link

jsvptf22 commented Jul 2, 2020

thanks

@kevingamaa
Copy link

thanks

@marcelofabianov
Copy link

thanks :D

@g14wx
Copy link

g14wx commented Sep 25, 2021

Hi, how I can achive this but with php7.4, I've installed php7.4 alongside php8, but this only works with php 8 (default one), but how to setup xdebug for php7.4?

@AmraniCh
Copy link

Thank you 👍

@elidrissidev
Copy link

elidrissidev commented Nov 14, 2021

@g14wx
For php 7 users, the easiest way I found is to follow the xdebug wizard on their site, once you paste your phpinfo output it will guide you through. And to save you some headache, phpize7 binary is included with php 7 in arch, so you don't need to look for php-dev package, because it doesn't exist.

@elidrissidev
Copy link

elidrissidev commented Nov 14, 2021

For xdebug 3.x you should change your xdebug.ini to:

 zend_extension=xdebug.so
-xdebug.remote_enable=on
-xdebug.remote_host=127.0.0.1
-xdebug.remote_port=9000
-xdebug.remote_handler=dbgp
-xdebug.cli_color = 2
+xdebug.mode = develop,debug
+xdebug.start_with_request = trigger
+xdebug.client_port = 9003

@g14wx
Copy link

g14wx commented Nov 25, 2021

Thanks a lot!

@bensaadmucret
Copy link

Thanks a lot!

@aginanjar
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment