# IntelliJ IDEA 在校验 PHP Debug 配置的时候提示 Xdebug 扩展没有载入

**URL:** <https://www.isharkfly.com/t/intellij-idea-php-debug-xdebug/13889>\
**Category:** PHP\
**Tags:** php\
**Created:** [February 23, 2022, 9:11pm UTC](https://www.isharkfly.com/t/intellij-idea-php-debug-xdebug/13889 "2022-02-23T21:11:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [February 23, 2022, 9:11pm UTC](https://www.isharkfly.com/t/intellij-idea-php-debug-xdebug/13889/1 "2022-02-23T21:11:39Z")

</div>

出现的错误信息如下图显示的：

![php-xdebug-install-01](https://www.isharkfly.com/images/transparent.png)

## 原因和问题解决

上面问题的主要原因是 Xdebug 扩展没有在你的 PHP 环境中进行配置。

找到 php.ini 文件，然后添加下面的内容。

```auto
[XDebug]
zend_extension = "php_xdebug.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "/xampp/tmp"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "/xampp/tmp/xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "/xampp/tmp"
xdebug.remote_cookie_expire_time = 36000

```

上面的内容为你添加到本地 php.ini 中的。

完成添加后，重启 xampp 服务器。

![php-xdebug-install-02](https://www.isharkfly.com/images/transparent.png)

然后访问本地的 [http://localhost/dashboard/phpinfo.php](http://localhost/dashboard/phpinfo.php) 的链接，如果你能够看到有关 Xdebug 的内容的话，则说明已经配置成功了。

![php-xdebug-install-04](https://www.isharkfly.com/images/transparent.png)

然后再重新校验。

如果你能看到下面的界面，则说明配置已经完成了。

![php-xdebug-install-05](https://www.isharkfly.com/images/transparent.png)

显示调试的配置已经完成了。
