I've just installed the latest XAMPP for PHP 5.6 from the official website, and I need to enable Xdebug, I find that the file php_xdebug.dll
exists in the C:\xampp\php\ext
, but there is no [XDebug]
config at all in the php.ini
and I have no idea how to make it work. It should be installed by default and pre-configured, we need just to uncomment the xdebug config in php.ini
but it's not the case. I even tried to install it again using PECL
commmand pecl install xdebug
but I get the following error :
pecl install xdebug
downloading xdebug-2.5.0.tgz ...
Starting to download xdebug-2.5.0.tgz (267,640 bytes)
.........done: 267,640 bytes
ERROR: failed to mkdir C:\php\pear\docs\xdebug\contrib
And in PHPStorm when I choose to add the interpreter by selecting the php.exe
in the XAMPP directory, it says Debugger : Not installed
too.
I re-installed XAMPP, but I still have the same problem. Thanks in advance.
For more details, you can find a tutorial that explains step by step procedure php-debugging-with-xdebug-atom-and-xampp
As per this tutorial please follow these steps its works like a charm:
Steps to Install Xdebug:
Unpack the downloaded file
# navigate to the downloaded file
$ cd ~/Downloads
$ tar -xvzf xdebug-2.4.0.tgz
$ cd xdebug-2.4.0
run phpize
$ phpize
# example output
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
#Error possibilty
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
#In the above error case you need to install autoconf using below command(MAC) and rerun phpize
$ brew install autoconf
The phpsize command is used to prepare the build environment for a PHP extension.
Configure it by run:
$ ./configure
run make
$ make
A successful install will have created xdebug.so file.
Steps to Configure Xdebug:
A successful install will have created xdebug.so and put it into the PHP extensions directory.
You must copy this file to XAMPP php extension directory for that run:-
$ sudo cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303
Finally update /Applications/XAMPP/xamppfiles/etc/php.ini
and add
the following lines to it
[Xdebug]
zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=On
xdebug.remote_port="9000"
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
Congratz! You have completed!! To verify you successfully installed & configured XDebug, open the XAMPP phpinfo.php file in a web browser, for example, http://localhost/dashboard/phpinfo.php.
Safest was is to use XDebug wizard that will give you step by step instructions on how to install on your own machine. Then update your php.ini (tune to your needs)
Note: Wizard will give you instructions for what SAPI it receives phpinfo()
contents from. So if you fill CLI phpinfo()
output you will get instructions for your PHP CLI. If you paste phpinfo()
from a server page you will get instructions for that.
First copy your phpinfor() content form. paste the [xdebug wizard][1] [1]: https://xdebug.org/wizard. then download the xdebug.dll. after that follow this steps
Remove the exists php_xdebug.dill and paste the xampp\php\ext\php_xdebug.dll
update the php.ini like this
[Xdebug] zend_extension = "C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=1 debug.remote_autostart=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With