简体   繁体   English

Xdebug 没有与 WAMP 一起运行

[英]Xdebug is not running with WAMP

My System is我的系统是

  1. Windows 10 with the newest updates Windows 10 最新更新
  2. Firefox Browser with the newest version Firefox 浏览器最新版本
  3. Expression Web as developing tool表达式 Web 作为开发工具
  4. WampServer Version 3.0.6 64bit as web server WampServer 版本 3.0.6 64 位作为 web 服务器

I installed xdebug dll like it was mentioned in https://xdebug.org/docs/install .我安装了 xdebug dll ,就像https://xdebug.org/docs/install中提到的那样。

php.ini: php.ini:

[xdebug]
zend_extension=F:\wamp64\bin\php\php5.6.25\ext\php_xdebug-2.5.0-5.6-vc11-x86_64.dll
  • I restarted wamp server我重新启动了 wamp 服务器
  • I refreshed wamp server我刷新了 wamp 服务器
  • I looked in php.ini and found the zend-Logo and this我查看了 php.ini 并找到了 zend-Logo 和这个

    Compiler MSVC11 (Visual C++ 2012)编译器 MSVC11 (Visual C++ 2012)
    ... ...
    This program makes use of the Zend Scripting Language Engine:该程序使用 Zend 脚本语言引擎:
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies Zend Engine v2.6.0,版权所有 (c) 1998-2016 Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans使用 Xdebug v2.5.0,版权所有 (c) 2002-2016,作者 Derick Rethans

  • I run the test at https://xdebug.org/wizard.php and got我在https://xdebug.org/wizard.php运行测试并得到

    Summary Xdebug installed: no Server API: Command Line Interface Windows: yes - Compiler: MS VC11 - Architecture: x64 Zend Server: no PHP Version: 5.6.25 Zend API nr: 220131226 PHP API nr: 20131226 Debug Build: no Thread Safe Build: yes Configuration File Path: C:\WINDOWS Configuration File: F:\wamp64\bin\php\php5.6.25\php.ini Extensions directory: F:\wamp64\bin\php\php5.6.25\ext
  • I run php -m in command line and found no xdebug module我在命令行中运行php -m发现没有 xdebug 模块

[PHP Modules] bcmath bz2 calendar calendar Core ctype curl date dom ereg exif fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap libxml mbstring mcrypt mhash mysql mysqli mysqlnd odbc openssl pcre PDO pdo_mysql pdo_sqlite Phar Reflection session shmop SimpleXML soap sockets SPL sqlite3 standard tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib [Zend Modules]

Now I really do not know what went wrong and what I can do to use xdebug.现在我真的不知道出了什么问题以及我可以做什么来使用 xdebug。 Looking for some helpful ideas.寻找一些有用的想法。

WAMPServer comes with XDEBUG already installed. WAMPServer 已经安装了 XDEBUG。 But only in the php.ini that is used by Apache.但仅在 Apache 使用的php.ini中。

If you want it available for the PHP CLI then all you have to do is如果您希望它可用于 PHP CLI,那么您所要做的就是

  1. Open the php.ini using wampmanager->php->php.ini使用wampmanager->php->php.ini打开wampmanager->php->php.ini
  2. Go to the bottom of the php.ini file转到 php.ini 文件的底部
  3. Copy the complete [xdebug] section复制完整的 [xdebug] 部分
  4. Edit \\wamp\\bin\\php\\php{version}\\php.ini (whichever version you are using, or all the versions)编辑 \\wamp\\bin\\php\\php{version}\\php.ini(无论您使用的是哪个版本,或所有版本)
  5. Paste the [xdebug] section into the bottom of the file将 [xdebug] 部分粘贴到文件底部
  6. Save php.ini保存 php.ini

Then it will also work in the PHP CLI然后它也可以在 PHP CLI 中工作

If you want the latest version of XDEBUG then go here http://wampserver.aviatechno.net/ and download the XDEBUG ADDON Update xDebug 2.5.0 32 bit x86 or Update xDebug 2.5.0 64 bit x64 depending on which version of WAMPServer you installed (32 or 64 bit)如果您想要最新版本的 XDEBUG,请访问http://wampserver.aviatechno.net/并下载 XDEBUG ADDON Update xDebug 2.5.0 32 bit x86Update xDebug 2.5.0 64 bit x64具体取决于您使用的 WAMPServer 版本已安装(32 或 64 位)

You can also download the latest version of WAMPServer Wampserver update 3.0.8 ADDON while you are there, this just upgrades the WAMPServer control code and not any versions of APACHE,MYSQL or PHP.您还可以在Wampserver update 3.0.8下载最新版本的 WAMPServer Wampserver update 3.0.8 ,这只是升级 WAMPServer 控制代码,而不是任何版本的 APACHE、MYSQL 或 PHP。

But there are also ADDONS available there that will add the latest versions of Apache, Mysql and PHP as well as well as latest versions of phpMyAdmin/Sysinfo and Adminer但是那里也有可用的插件,可以添加最新版本的 Apache、Mysql 和 PHP 以及最新版本的 phpMyAdmin/Sysinfo 和 Adminer

I suggest you get rid of whatever version of XDEBUG you downloaded我建议你摆脱你下载的任何版本的 XDEBUG

如果调试器仍然无法工作,请确保您在 php.ini 文件中启用了 xdebug.remote_enable。

Just do below steps只需执行以下步骤

Goto service running greenIcon->Php->php extensions->zend extensions->select installed php_xdebug_version.转到运行 greenIcon->Php->php extensions->zend extensions->选择已安装的 php_xdebug_version 的服务。

After goto php.ini file search [opcache] -> below [opcache] line comment zend_extension.在转到 php.ini 文件搜索 [opcache] -> 下面 [opcache] 行注释 zend_extension。 Save then然后保存

restart service.重启服务。

1- Open the php.ini using wampmanager->php->php.ini 1- 使用 wampmanager->php->php.ini 打开 php.ini

2- Go to the bottom of the php.ini file 2- Go 到 php.ini 文件的底部

3- Edit \wamp\bin\php\php{version}\php.ini (whichever version you are using, or all the versions) 3- 编辑 \wamp\bin\php\php{version}\php.ini (无论您使用哪个版本,或所有版本)

4- Paste the [xdebug] section into the bottom of the file 4- 将 [xdebug] 部分粘贴到文件底部

[xdebug]
zend_extension="c:/wamp64/bin/php/php8.1.0/zend_ext/php_xdebug-3.1.1-8.1-vs16-x86_64.dll"
xdebug.mode = debug
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.start_with_request = yes
xdebug.client_host = "127.0.0.1"

5- Save php.ini 5- 保存 php.ini

6- restarted wamp server 6-重启wamp服务器

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM