Ok so we are going to remove xdebug from our macos system completely. Follow the steps and all should be working.
1st we need to check where our php.ini file is located for this run this command in terminal
php -i | grep php.ini
It will show you the output something like this
In my case php version is 8.1, you might have different.
use this command
// Again edit php version according to your php version sudo nano /usr/local/etc/php/8.1/php.ini
In nano editor remove any setting which has xdebug in it and zend_extension. You can also comment these lines using ";" in front of the line.
Once done save it and restart php using command
// Again edit php version according to your php version brew services restart php@8.1
Now if you check php version there should not be any xdebug info as we removed it.