Skip to content
This repository has been archived by the owner. It is now read-only.

Cannot link php71: /usr/local/sbin is not writable #4527

alxvallejo opened this issue Oct 16, 2017 · 8 comments


Copy link

@alxvallejo alxvallejo commented Oct 16, 2017


I'm trying to install Laravel Valet, which requires php71, so when i run brew install php71 I run into this error:

Could not symlink sbin/php-fpm
/usr/local/sbin is not writable.

This also occurs if i try to manually link with brew link.

I don't even have an sbin directory so I'm pretty lost on how to proceed.

What is interesting is that if i run php -v, I get php 7.1.7, but when i run valet install, i get

Unable to determine linked PHP.

Context and Logs

Parameter Value
macOS version: High Sierra 10.13
Homebrew version: Homebrew 1.3.5
PHP version in use: PHP 7.1.7
Xcode version: Xcode 9.0

Output of gcc -v:
Configured with: --prefix=/Applications/ --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin17.0.0
Thread model: posix
InstalledDir: /Applications/

Output of php -v:
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies


This comment has been minimized.

Copy link

@SMillerDev SMillerDev commented Oct 17, 2017

Google provided me with this answer, maybe it helps?

As for the PHP71 install, what was the full command you ran? What happens when you do brew link php71? What was the full error output?


This comment has been minimized.

Copy link

@dadave92 dadave92 commented Oct 20, 2017

The folder /usr/local/sbin does not exists if i try to run this comment:
sudo chown -R 'whoami':admin /usr/local/sbin

Why does homebrew uses sbin instead of the bin folder?


This comment has been minimized.

Copy link

@jchenrev jchenrev commented Oct 25, 2017

I have the same issue with linking hadoop.
I don't even have a /usr/local/sbin folder and /usr/local/sbin is not in my PATH.
My operating system is also OSX High Sierra 10.13 and home-brew version is 1.3.6

$ brew link hadoop
Linking /usr/local/Cellar/hadoop/2.8.1...
Error: Could not symlink sbin/
/usr/local/sbin is not writable.

This comment has been minimized.

Copy link

@alxvallejo alxvallejo commented Oct 25, 2017


This comment has been minimized.

Copy link

@viktorbijlenga viktorbijlenga commented Nov 7, 2017

I’m having the same issue. +1


This comment has been minimized.

Copy link

@Honest-Objections Honest-Objections commented Nov 22, 2017

While I'm new to OSX, my guess is that the sbin folder is no longer created by default in High Sierra. Here is a nice extract explaining the folders purpose (as I was curious and din't want to make it arbitararily):

    This directory contains executable programs which are needed
    in single user mode and to bring the system up or repair it.

    Like /bin, this directory holds commands needed to boot the 
    system, but which are usually not executed by normal users.

So to solve the problem, simply create the directory with sudo mkdir /usr/local/sbin and then set the correct ownership on it with sudo chown -R `whoami`:admin /usr/local/sbin.


This comment has been minimized.

Copy link

@Qifan-Guo Qifan-Guo commented Nov 24, 2017

first Create an sbin in your local dir.
sudo mkdir sbin
then if you are running the High Sierra 10+
sudo chown -R $(whoami) $(brew --prefix)/*

then you should be able to brew link php71


This comment has been minimized.

Copy link

@stale stale bot commented Dec 15, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
7 participants
You can’t perform that action at this time.