I had a problem which appeared all of the sudden saying:
Unable to determine linked PHP. which I could not solve so I uninstalled valet, php and dependencies. Then I installed fresh php7.1 but when I run valet install I get quiet slightly similar error: Homebrew PHP appears not to be linked.
            Asked
            
        
        
            Active
            
        
            Viewed 1.6k times
        
    19
            
            
         
    
    
        Epsilon47
        
- 768
- 1
- 13
- 28
- 
                    1Possible duplicate of https://stackoverflow.com/questions/37178743/laravel-valet-linked-php-error – Valentin Knyazev Apr 30 '19 at 09:06
- 
                    @ValentinKnyazev there is plenty of topics about question you posted. It is not my case – Epsilon47 Apr 30 '19 at 09:11
- 
                    1Homebrew can't find the correct PHP version, have you linked them up properly? brew link php71 – Wouter Van Damme Apr 30 '19 at 09:49
- 
                    @WouterVanDamme thank you. That was it. I tried it dozen times before but it did not have effect, now it did :D It was never needed to link it explicitly – Epsilon47 Apr 30 '19 at 10:18
- 
                    @Paul Well the answer with big green check icon does:) – Epsilon47 Jan 18 '20 at 22:40
6 Answers
37
            
            
        First, find the PHP version installed via.
brew list
In my case it was php@7.3, then
brew link php@7.3 --force --overwrite
and finally
valet install
:)
 
    
    
        zarpio
        
- 10,380
- 8
- 58
- 71
11
            Homebrew can't find the correct PHP version, have you linked them up properly?
brew link php71 
 
    
    
        Wouter Van Damme
        
- 761
- 9
- 15
5
            
            
        brew link php@7.2 --force --overwrite
That will push this--
If you need to have this software first in your PATH instead consider running: echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
I ran both independently then tried valet install (worked like a charm).
 
    
    
        PT-83
        
- 309
- 5
- 18
0
            
            
        - 
                    4Please, add an explanation. See [how to answer](https://stackoverflow.com/help/how-to-answer). – Syscall Apr 13 '21 at 08:43
0
            
            
        If you are coming here following a migration from Intel to M1 and having Valet not use the php cask from the /opt/ folder, this did the trick for me:
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc.
 
    
    
        Tommaso Boggia
        
- 140
- 2
- 12
 
     
    