【问题标题】:Visual Studio Code returns a php xdebug errorVisual Studio Code 返回一个 php xdebug 错误
【发布时间】:2020-05-28 09:55:28
【问题描述】:

我有以下安装

  • Windows 10
  • Lavarel 与 PHP C:\laragon\bin\php\php-7.2.19-Win32-VC15-x64
  • Windows 路径 C:\laragon\bin\php\php-7.2.19-Win32-VC15-x64 中的 php
  • 带有 PHP IntelliSense 和 PHP Debug 的最新版 Visual Code

在 Windows 终端中 php -v 返回这个

PHP 7.2.19 (cli) (built: May 29 2019 13:58:59) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.1, Copyright (c) 2002-2020, by Derick Rethans

问题描述: 我用这样的简单测试代码打开 Visual Studio Code 和一个 php 文件

<?php
echo "test";
?>

当我在 Visual Studio 中单击 OUTPUT 面板时,我会收到此信息

DEBUG     Checking PHPLS_ALLOW_XDEBUG
DEBUG     The xdebug extension is loaded (2.9.1)

DEBUG     Process restarting (PHPLS_ALLOW_XDEBUG=internal|2.9.1|0|*|*)
DEBUG     Running C:\laragon\bin\php\php-7.2.19-Win32-VC15-x64\php.exe -n -c C:\Users\graziano\AppData\Local\Temp\1ABE.tmp c:\Users\graziano\.vscode\extensions\felixfbecker.php-intellisense-2.3.14\vendor\felixfbecker\language-server\bin\php-language-server.php --tcp=127.0.0.1:49716 --memory-limit=4095M

DEBUG     Checking PHPLS_ALLOW_XDEBUG
DEBUG     Restarted (65 ms). The xdebug extension is not loaded

为什么会返回“未加载 xdebug 扩展”? OUTPUT 页面不应返回脚本 echo "test" ?

【问题讨论】:

    标签: visual-studio-code


    【解决方案1】:

    你的zend_extension在缓存的php.ini中被注释掉了

    ;zend_extension = xxx.dll C:\Users\graziano\AppData\Local\Temp\1ABE.tmp

    【讨论】:

      猜你喜欢
      • 2020-07-23
      • 1970-01-01
      • 2022-11-29
      • 2019-03-31
      • 2019-02-10
      • 2019-12-10
      • 2019-12-30
      • 2017-10-23
      • 2022-07-25
      相关资源
      最近更新 更多