# Install Xdebug for PHP7.2 on Valet
```
$ pecl install xdebug
```
If error: ERROR: 'phpize' failed
Download autoconf $ curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz
Untar the autoconf archive $ tar -xvzf autoconf.tar.gz
Configure and make – note the folder un-archived may have a different name. $ cd autoconf-2.69 $ ./configure $sudo make && sudo make install
Or
Create a file with phpinfo()
Paste in https://xdebug.org/wizard.php
And follow the instructions:
1. Download xdebug-2.6.0.tgz
2. Unpack the downloaded file with tar -xvzf xdebug-2.6.0.tgz
3. Run: $ cd xdebug-2.6.0
4. Run: $ phpize
5. Run: $ ./configure
6. Run: $ make
7. Run: $ cp modules/xdebug.so /usr/local/lib/php/pecl/20170718
8. Edit /usr/local/etc/php/7.2/php.ini and add the line [XDebug]
zend_extension = /usr/local/lib/php/pecl/20170718/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
Restart the webserver
Add this in the bash_profile or zshrc
export XDEBUG_CONFIG="idekey=VSCODE"