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. Here are all my configurations:
I modified the /usr/local/etc/php/7.2/php.ini
which I get from:
$ 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:
$ pecl install xdebug
To confirm that I have the xdebug.so
:
The output from php -m
is as follows:
[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:
I also looked all over the content, but there is nothing connected to xdebug
.
Should also note that I restarted my local server before the phpinfo() output:
$ php bin/console server:start --force
My php version (Also you can see that it's showing Xdebug as properly enabled):
❯ 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. 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.