简体   繁体   English

XDebug 没有在 phpinfo() 的 output 中列出

[英]XDebug not listed in the output of phpinfo()

I am trying to enable XDebug so I can use it along with the PHPStorm (I am on Mac) and although I do not have any errors XDebug is not listed in the phpinfo() output. I also tried with XDebug wizard but with the same result.我正在尝试启用 XDebug,以便我可以将它与 PHPStorm 一起使用(我在 Mac 上),虽然我没有任何错误,但 XDebug 未在 phpinfo() output 中列出。我也尝试使用 XDebug 向导,但使用相同的结果。 Here are all my configurations:这是我所有的配置:

I modified the /usr/local/etc/php/7.2/php.ini which I get from:我修改了/usr/local/etc/php/7.2/php.ini我从中得到的:

$ php --ini:

Configuration File (php.ini) Path: /usr/local/etc/php/7.2
Loaded Configuration File:         /usr/local/etc/php/7.2/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.2/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.2/conf.d/ext-opcache.ini

with the following:具有以下内容:

zend_extension ="/usr/local/lib/php/pecl/20170718/xdebug.so"

[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM

xdebug.so was installed with pecl without any errors: xdebug.so是用 pecl 安装的,没有任何错误:

$ pecl install xdebug

To confirm that I have the xdebug.so :确认我有xdebug.so

在此处输入图像描述

The output from php -m is as follows:来自php -m的 output 如下:

[PHP Modules]
ast
bcmath
...
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

After all this configurations I run:在我运行所有这些配置之后:

$ sudo apachectl restart

But in the output of phpinfo() I do not have it enabled:但是在phpinfo()的 output 中我没有启用它:

在此处输入图像描述

I also looked all over the content, but there is nothing connected to xdebug .我也查看了所有内容,但没有任何内容与xdebug相关。

Should also note that I restarted my local server before the phpinfo() output:还应该注意,我在 phpinfo() output 之前重新启动了本地服务器:

$ php bin/console server:start --force

My php version (Also you can see that it's showing Xdebug as properly enabled):我的 php 版本(您还可以看到它显示 Xdebug 已正确启用):

❯ php -v
PHP 7.2.27 (cli) (built: Jan 24 2020 03:49:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.3, Copyright (c) 2002-2020, by Derick Rethans
    with Zend OPcache v7.2.27, Copyright (c) 1999-2018, by Zend Technologies

As @LazyOne suggested, I tried rebooting my system and everything started working properly.正如@LazyOne 建议的那样,我尝试重新启动系统,一切都开始正常工作。 Looks like something was needing a reboot to start using the new settings/configurations.看起来有些东西需要重新启动才能开始使用新的设置/配置。 So if you tried everything and all looks good from configuration point, try rebooting your system.因此,如果您尝试了所有方法并且从配置点来看一切正常,请尝试重新启动系统。

Restarting the pc it's working fine.重新启动电脑它工作正常。

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

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