简体   繁体   English

xDebug在命令行“ php -m”中显示,但不在phpinfo()中显示

[英]xDebug shows up in command line “php -m” , but not in phpinfo()

I am on windows 7, 64bit, with xampp 3.2.1 installed . 我在安装了xampp 3.2.1的Windows 7、64bit上。 I got my xdebug dll file through the xdebug.org wizard, and put it where the wizard told me to, C:\\xampp\\php\\etc. 我通过xdebug.org向导获取了xdebug dll文件,并将其放在向导告诉我的位置C:\\ xampp \\ php \\ etc。 Then I made sure to modify the correct (and as far as I'm aware only) php.ini file at C:\\xampp\\php\\php.ini. 然后,我确保在C:\\ xampp \\ php \\ php.ini中修改正确的(据我所知)php.ini文件。 This is the same ini that phpinfo() reports. 这与phpinfo()报告的ini相同。

When I run php -m , I can see the xDebug extension listed twice, just as it should be. 当我运行php -m时,我可以看到xDebug扩展名被列出了两次,正如它应该的那样。 But going back to a phpinfo() output, the extension is not listed. 但是返回phpinfo()输出,未列出扩展名。

I've tried restarting my computer, apache. 我已经尝试过重新启动计算机,Apache。 If I try to run this script to test if xdebug is working, it gives me a error 如果我尝试运行此脚本以测试xdebug是否正常运行,则会给我一个错误

socket_bind(): unable to bind address [10048]:Only one usage of each socket address (protocol/network address/port) is normally permitted socket_bind():无法绑定地址[10048]:通常只允许每个套接字地址(协议/网络地址/端口)使用一次

After hours of hair pulling... and a nap, I came across this config code and it somehow worked. 经过数小时的梳理……和午睡,我遇到了这个配置代码,它以某种方式起作用。 Now that the extension is on firm ground, I can start carefully adding or removing features one at a time. 既然扩展已经牢固,那么我可以开始仔细地一次添加或删除功能。

zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.5-5.5-vc11.dll" // whatever your file name is
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host= "localhost"
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

The root problem was a messed up php.ini file. 根本问题是一个混乱的php.ini文件。 The problem is that xampp's php.ini has some defaults listed there that we are told to uncomment by xdebug,netbeans, other online guides. 问题是xampp的php.ini中列出了一些默认值,xdebug,netbeans和其他在线指南都告诉我们取消注释。 Unfortunately, given the certain combinations of values, that just didn't work. 不幸的是,鉴于某些特定的价值观组合,这根本行不通。 This list of parameters definitely worked for me though. 不过,此参数列表肯定对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 xdebug没有显示在`php -m`的输出中,但是显示在phpinfo中 - xdebug not showing in output of `php -m` but shows in phpinfo PHP MongoDB扩展名显示在phpinfo()上,而不显示在命令行上? - PHP MongoDB extension shows up on phpinfo() but not on command line? Xdebug 已安装,但未显示在 phpinfo 上 - Xdebug is installed, but not showing up on phpinfo 为什么xdebug没有出现在phpinfo()中 - Why is xdebug not showing up in phpinfo() 为什么网页中的 phpinfo() 显示 5.6 版,而命令行中的 php -v 显示 7.3 版? - Why does phpinfo() in webpage show version 5.6, but php -v from command line shows 7.3? 未定义的类常量'MYSQL_ATTR_INIT_COMMAND'; phpinfo没有显示PDO扩展名,但是php -i(php -m)可以 - Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'; phpinfo shows no PDO extensions, but php -i (php -m) do MAMP:PHP -m 显示 oci8 已启用,但不在 phpinfo 中 - MAMP: PHP -m shows oci8 enabled, but not in phpinfo Xdebug 3 未显示在 m1 Monterey 的 phpinfo 中 - Xdebug 3 not showing in phpinfo on m1 Monterey 如何为 MacOS Big Sur 启用 Xdebug? "php -m" 显示正常,但是 "phpinfo();" 别 - How to enable Xdebug for MacOS Big Sur? "php -m" show its ok, but "phpinfo();" don't phpinfo() 中没有 xdebug - No xdebug in phpinfo()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM