Install oAuth PECL error: Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user

Viewed 24643

I'm trying to instal oAuth on OS X, but I am getting this error in the Terminal:

Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user

How do I allow it to be writable?

4 Answers

For further references, on OS Catalina, due to write permission on /usr/bin - lib folders, you should move all config folders on pecl to some writable location (except php_bin which is php directory, this one should point to your php folder).

This is due to a feature in Mac OS called System Integrity Protection (SIP). SIP prevents the editing of critical system files and directories.

To get around SIP restrictions for the purposes of installing oAuth, you can disable it temporarily. Boot into recovery mode and run the command csrutil disable. After that, rebooting normally and attempt the install again.

After the install has been completed, re-enable SIP by booting back into recovery mode and running the command csrutil enable. Note: it's highly recommended that you re-enable SIP to protect your computer.

Related