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?
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?
First find out where the php_dir is. You can do this by using the 'config-get' command:
pecl config-get php_dir
After this you can either:
Change the ownership of that folder (and any needed child folders)
sudo chown <username> <php_dir>
or
Set the php_dir to a different folder
pecl config-set php_dir /path/to/new/dir
sudo chown $(whoami) $(pecl config-get php_dir)
–
Eldoneldora The easiest way is probably to append sudo
to the front of your install command.
See http://linux.about.com/od/commands/l/blcmdl8_sudo.htm to read more about the handy "super user" command.
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.
© 2022 - 2024 — McMap. All rights reserved.