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

4

22

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?

Loralyn answered 22/7, 2012 at 5:23 Comment(0)
F
30

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

Freestanding answered 5/8, 2012 at 1:18 Comment(2)
should be "sudo chown" (not chmod) above otherwise good suggestionBenzyl
if someone prefers one-liner: sudo chown $(whoami) $(pecl config-get php_dir)Eldoneldora
U
21

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.

Ursola answered 10/7, 2013 at 21:29 Comment(1)
Same OP error still comes up when using sudo. MacOS 11.0.1Coating
G
0

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).

Grover answered 19/10, 2020 at 14:38 Comment(1)
any suggestions what dirs could be in mac?Bashibazouk
C
0

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.

Cypsela answered 23/7, 2021 at 3:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.