Cannot configure xdebug; "Operation not permitted" error when trying to cp I'm trying to configure xdebug, but when I run the command 

cp Downloads/xdebug-2.6.1/xdebug-2.6.1/modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20160303

I get a "Operation not permitted" warning from the terminal, even when I use sudo

I checked the security and privacy settings to make sure the terminal had full disk access and made sure the files in question were unlocked. 

What else could be prompting this error?
You need to temporarily disable System Integrity Protection

https://www.howtogeek.com/230424/how-to-disable-system-integrity-protection-on-a-mac-and-why-you-shouldnt/