XDebug configuration missing from php.ini in XAMPP
Solution 1
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:
- Download xdebug-2.4.0.tgz
-
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
- Restart Apache using XAMPP’s manager-osx
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.
- Search for XDebug section in PHPInfo details. If it exists, you successfully have done your installation OR
- In another browser window or tab, open https://xdebug.org/wizard.php and copy the phpinfo.php page content in the first window or tab and paste it into the textbox on the xdebug.org page. Then submit for analysis, it will give a summary of your installation status.
Solution 2
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.
Solution 3
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
Dwix
Updated on July 09, 2022Comments
-
Dwix almost 2 years
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 theC:\xampp\php\ext
, but there is no[XDebug]
config at all in thephp.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 inphp.ini
but it's not the case. I even tried to install it again usingPECL
commmandpecl 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 saysDebugger : Not installed
too.I re-installed XAMPP, but I still have the same problem. Thanks in advance.
-
robertmain over 6 yearsThe wizard doesn't open for me. I get the summary and then nothing else.
-
BeNice about 5 yearsIf I could give you 2 ups I would. Forgot about this - lifesaver!
-
Tomáš Fejfar about 5 yearsHappy it helped! :)
-
CodeToLife about 4 years1st link is dead
-
El Amrani Chakir over 2 yearsThank you! I've missed the php.ini configs!