php phpinfo() 中没有 xdebug

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3793390/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 11:08:28  来源:igfitidea点击:

No xdebug in phpinfo()

phpxdebug

提问by sergtk

I have added following lines into php.ini

我在 php.ini 中添加了以下几行

[XDebug]
zend_extension = C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

Version of php_xdebug-2.1.0-5.3-vc9.dllis obtained via page http://www.xdebug.org/find-binary.php.

的版本php_xdebug-2.1.0-5.3-vc9.dll是通过页面http://www.xdebug.org/find-binary.php获得的。

But there are no any mentions of 'xdebug' string in output of phpinfo().

但是在phpinfo().

What can be wrong?

有什么问题?

(This is my second fight with php-xdebug to get working, first time I gave up. If you have other suggestions concerning debugging please add them also, possibly as comments to the question. I would like to following scenario work under windows: "Set up break point, run my script, it stops on break point and I can see the value of some variable". Thanks)

(这是我第二次使用 php-xdebug 开始工作,第一次我放弃了。如果您有关于调试的其他建议,也请添加它们,可能作为对问题的评论。我想在 Windows 下进行以下场景工作:“设置断点,运行我的脚本,它在断点处停止,我可以看到某个变量的值”。谢谢)

UPDATE

更新

Restart of Apache does not resolve the issue. In log file the message appears:

重新启动 Apache 不能解决问题。在日志文件中出现消息:

Apache/2.2.14 (Win32) PHP/5.3.1 configured - resuming normal operations

Apache/2.2.14 (Win32) PHP/5.3.1 配置 - 恢复正常操作

采纳答案by sergtk

zend_extension = C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll

should be replaced by

应该替换为

zend_extension="C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll"

P.S. Will e-mail xdebug guys.

PS 会给 xdebug 的人发电子邮件。

回答by Flion

check the top of the output of

检查输出的顶部

php -m

for me it showed an error in php.ini, after solving that xdebug was loaded.

对我来说,它在 php.ini 中显示了一个错误,在解决了 xdebug 被加载后。

回答by Ger Groot

This worked for me (vscode, xampp) Go to https://xdebug.org/wizard.phpand paste the contents of phpinfo()

这对我有用(vscode,xampp)转到https://xdebug.org/wizard.php并粘贴 phpinfo() 的内容

Then download the right xdebug.dll and place it in your 'ext' folder.

然后下载正确的 xdebug.dll 并将其放在您的“ext”文件夹中。

Add the following to your php.ini

将以下内容添加到您的 php.ini

[XDebug]
zend_extension="php_xdebug-2.5.4-7.0-vc14.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1

回答by westor

I just had the same problem, nothing of this worked for me. I started php in the console and I saw, php was unable to load the dll from the given path. The solution for me was to omit the path information and only load it like this:

我只是遇到了同样的问题,这些都不适合我。我在控制台中启动了 php,我看到 php 无法从给定的路径加载 dll。我的解决方案是省略路径信息,只像这样加载它:

zend_extension="php_xdebug-2.2.5-5.5-vc11.dll"

回答by Gainster

You can follow this tutorial on getting started with xdebug : http://devzone.zend.com/article/2803-Introducing-xdebug

您可以按照本教程开始使用 xdebug:http://devzone.zend.com/article/2803-Introducing-xdebug

Xdebug and ZendDebug are two separate debuggers, it's up to you to decide which one to use. Either one is pretty easy to setup. Only a couple of steps in Eclipse.

Xdebug 和 ZendDebug 是两个独立的调试器,由您决定使用哪一个。任何一个都很容易设置。在 Eclipse 中只需几个步骤。

Post the content from your php info page into this page to find out which version to download : http://www.xdebug.org/find-binary.php

将您的 php 信息页面中的内容发布到此页面以找出要下载的版本:http: //www.xdebug.org/find-binary.php

回答by P.Pal

I was just struggling with this myself and found a way to identify (and solve) the problem. It works on Xampp and Windows 7 at least.

我自己只是在为此苦苦挣扎,并找到了一种识别(并解决)问题的方法。它至少适用于 Xampp 和 Windows 7。

In my case the problem was dots. Renaming "php_xdebug-2.2.5-5.5-vc11.dll" to "php_xdebug.dll" did the job.

就我而言,问题是点。将“php_xdebug-2.2.5-5.5-vc11.dll”重命名为“php_xdebug.dll”完成了这项工作。

Another pro-tip is that newer versions of Xampp have Xdebug built-in, so you don't need to donwload it, just edit php.ini with:

另一个专业提示是,较新版本的 Xampp 内置了 Xdebug,因此您无需下载它,只需使用以下命令编辑 php.ini:

zend_extension = "path\to\php\ext\php_xdebug.dll"
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1 (or localhost)
xdebug.remote_port = 9000
xdebug.remote_mode = req

Then restart the apache and it should work. The advantage of using xampp built-in xdebug is that it's most likely the right version.

然后重新启动apache,它应该可以工作。使用 xampp 内置 xdebug 的优点是它很可能是正确的版本。

回答by Geoff Kendall

Writing in January 2019, I found that following the Xdebug Wizard at Xdebug wizard here

写于 2019 年 1 月,我发现在Xdebug 向导这里遵循Xdebug 向导

exactly, including using their download link to the correct version of Xdebug for your version of PHP and copying the line to insert on your php ini exactly as is, got Xdebug appearing in phpInfo for me. I was installing into Laragon . Running php -m from the command line gave a good confirmation of all being well, with Xdebug loading as a Zend Extension. Usual gotchas about needing to restart server etc apply.

确切地说,包括使用他们的下载链接到您的 PHP 版本的正确版本的 Xdebug 并复制该行以完全按原样插入您的 php ini,让 Xdebug 出现在我的 phpInfo 中。我正在安装到 Laragon 。从命令行运行 php -m 可以很好地确认一切正常,Xdebug 作为 Zend 扩展加载。关于需要重新启动服务器等的常见问题适用。

回答by Dimitri

Just for the newbees:

只为新手:

If you want to check if the .dll, specified in the php.ini is loading properly:

如果要检查 php.ini 中指定的 .dll 是否正确加载:

  1. Add php to the Windows Runtime Directory. For win10, refer to this post https://www.forevolve.com/en/articles/2016/10/27/how-to-add-your-php-runtime-directory-to-your-windows-10-path-environment-variable/

  2. From the Windows command prompt, type php -m and check if any error is displayed.

  1. 将 php 添加到 Windows 运行时目录。对于 win10,请参阅此帖子https://www.forevolve.com/en/articles/2016/10/27/how-to-add-your-php-runtime-directory-to-your-windows-10-path -环境变量/

  2. 在 Windows 命令提示符下,键入 php -m 并检查是否显示任何错误。

回答by chuixue

In my case the issue was the file path which apache loaded, the file php.ini I changed is not the current loaded config, so check it First.

在我的情况下,问题是 apache 加载的文件路径,我更改的文件 php.ini 不是当前加载的配置,因此首先检查它。

回答by FAHID

Its happen because of permission. you have to add the permission of that specific app/user profile from the folder's Properties Securitytab.

它的发生是因为许可。您必须从文件夹的“属性安全”选项卡中添加该特定应用程序/用户配置文件的权限

I use PHP with IIS server so. It worked for me by adding IIS_USERin security permission.

我将 PHP 与 IIS 服务器一起使用。它通过在安全权限中添加IIS_USER对我有用