XAMPP can not install xdebug

耗尽温柔 提交于 2020-01-12 05:13:05

问题


Hello I have installed xampp, changed the php.ini to this:

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.3-5.3-vc9.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C:\xampp\tmp"

So I created a php file:

<?php
phpinfo();
?>

Copy pasted the content and pasted in the xdebug wizard and got this output:

Tailored Installation Instructions

Summary

Xdebug installed: no
Server API: Apache 2.4 Handler Apache Lounge
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: no
PHP Version: 5.4.7
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\Windows
Configuration File: C:\xampp\php\php.ini
Extensions directory: C:\xampp\php\ext
Instructions

Download
Move the downloaded file to C:\xampp\php\ext
Edit C:\xampp\php\php.ini and add the line
zend_extension = C:\xampp\php\ext\
Restart the webserver
If you like Xdebug, and thinks it saves you time and money, please have a look at the donation page.

This tells me that it is not installed, so I followed the instructions and restarted the server. Opened the info php again, copied everything again and pasted it in the wizard again. Press the button and I get the exact same output, I don't know what I am doing wrong can anyone tell me what I do wrong?


回答1:


Step 1: goto https://xdebug.org/wizard.php

step 2: copy and paste your phpinfo output to textarea which will be displayed on https://xdebug.org/wizard.php

step 3: click on analyze my phpinfo() output button, it will analyze your system and based on that it will give you suitable php_xdebug.dll file that you need to put at D:\xampp\php\ext folder

step 4: edit your php.ini file and add following line zend_extension = D:\xampp\php\ext\your-php_xdebug.dll

step 5: Restart Server

Reference Video Tutorial : https://www.youtube.com/watch?v=HbJOP0YcSjs

complete video Tutorial for PHP Debug Example : Demo




回答2:


Recent XAMPP version(mine is v3.2.2) already had the file php_xdebug.dll in xampp\php\ext folder , so we don't need go to https://xdebug.org/wizard.php for downloading the file.

Just open the file xampp\php\php.ini, add the codes:

[xdebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"

Restart the XAMPP, then you could see the xdebug is working by type php --version in CMD:




回答3:


Have you rectified the issue ?, if not please try this. I am having the same situations as yours, and I got result by

1)php.ini file content

zend_extension = "c:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
;xdebug.remote_host="localhost:81"
xdebug.remote_host=192.168.1.5
;xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

please place the above mentioned dll at c:\xampp\php\ext\

xdebug.remote_host=192.168.1.5 - This is the IPv4 address of my system, I changed to this because I couldn't debug with localhost and 127.0.0.1.

in NetBeans IDE, open Tools-> Options->PHP->Debugging. The values of debugger port and Session Id should match with the port and idekey specified in php.ini

Now save php.ini, restart Apache and now try for debugging

Thanks Johnson




回答4:


I had the same problem and it was solved checking the versions of php and xampp: it turned out, xampp was 32 bits (installed in a 64 bits computer) and I chose the wrong version of xdebug (it has to be 32 bits).




回答5:


As mentioned earlier, make sure your xampp installation doesn't already have php_xdebug file in the php/ext folder before downloading xdebug dll. If the xampp/php/ext folder already has a php_xdebug file, just add 1 line in the php.ini file

[xdebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"



回答6:


In general this extension come with the XAMPP package (look into your \xampp\php\ext folder) but it's not added to your php.ini automatically.

add this line manually into your php.ini

extension=php_xdebug.dll

It's all ;) that worked for me



来源:https://stackoverflow.com/questions/16935347/xampp-can-not-install-xdebug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!