I just updated my MacOS to Big Sur and my localhost configuration was a mess. After reinstalling PHP and Xdebug, it seems my Xdebug is not working properly. I can see it is installed through php -m, but it is not listed in phpinfo();. Also, If I open a VSCode, start "Listen for XDebug", add a breakpoint to a file and run php -e FILENAME.php, the breakpoint works, but if I do the same using a browser, is doesn't.
Already tried the official tutorial that used homebrew and several other tutorials, since from installing it manually until doing all stuff automated. I'm out of clues here, any help or ideas are welcome. Thanks in advance.
Below follows my config:
- PHP: 7.4.10
- Xdebug config in php.ini
[xdebug]
zend_extension="/usr/local/Cellar/php/7.4.10/lib/php/20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
- VSCode launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"xdebugSettings": {
"max_data": -1
}
}
]
}
- "php -m" output
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
FFI
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_dblib
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
phpdbg_webhelper
posix
pspell
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Xdebug
Zend OPcache
- phpinfo() output (compacted since stackoverflow adds limit here)
PHP logo
PHP Version 7.4.10
...
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/etc/php/7.4
Loaded Configuration File /usr/local/etc/php/7.4/php.ini
Scan this dir for additional .ini files /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed /usr/local/etc/php/7.4/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini
PHP API 20190902
PHP Extension 20190902
Zend Extension 320190902
Zend Extension Build API320190902,NTS
PHP Extension Build API20190902,NTS
...
This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.4.0, Copyright (c) Zend Technologies
...
Edit: Double checked both "php -i" and "phpinfo();", the mention the same php.ini file: /usr/local/etc/php/7.4/php.ini