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

23,533

Solution 1

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

Solution 2

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.

Share:
23,533
Steve C
Author by

Steve C

Product designer and full-stack developer.

Updated on July 09, 2022

Comments

  • Steve C
    Steve C almost 2 years

    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?

  • vladko
    vladko about 10 years
    should be "sudo chown" (not chmod) above otherwise good suggestion
  • Raptor
    Raptor over 3 years
    if someone prefers one-liner: sudo chown $(whoami) $(pecl config-get php_dir)
  • MarsAndBack
    MarsAndBack over 3 years
    Same OP error still comes up when using sudo. MacOS 11.0.1
  • Gediminas
    Gediminas over 2 years
    any suggestions what dirs could be in mac?