1

I have been developing with Vallet for some time now. Today i wanted to update laravel 5.4 to 5.5. Before doing so i run composer global update. Causing Vallet to stop working.

Fist i tried to do the following:

cd ~/.composer/

sudo chown -R $(whoami) vendor

source: https://laracasts.com/discuss/channels/general-discussion/getting-valet-not-found-error

I did not solve the issue. Then i decided to reinstall Vallet. Hereby i did the following:

I followed this: https://github.com/laravel/valet/issues/321

Stop and uninstall services

sudo brew services stop php71 dnsmasq nginx
brew uninstall php71 dnsmasq nginx

Remove related config files and valet home folder

sudo rm -r /usr/local/etc/php /usr/local/etc/nginx /usr/local/etc/dnsmasq.conf
sudo rm -r ~/.valet /var/root/.valet

Install services i tried this:

brew install php71
$ brew tap homebrew/php
$ brew install php71
brew install homebrew/php/php71 

All gave the following error:

MacBook-Pro:~ mblivier$ brew install homebrew/php/php71 
==> Installing php71 from homebrew/php Error: The following formula: php71 
cannot be installed as a binary package and must be built from source.

Install the Command Line Tools:xcode-select --install

I new in this and don't know how to solve this. Any suggestions how to install php and go further with reinstalling Vallet?

  • homebrew is installed and working
mbo
  • 13
  • 6

2 Answers2

0

You need xcode to build php, so first run:

xcode-select --install

to install xcode and later you can brew install php71

r00t-err0r
  • 174
  • 1
  • 11
  • Thanks for your reaction. I did. Also runed ```brew install php71``` and started the php71. ```MacBook-Pro:applications mblivier$ brew services start php@7.1 ==> Successfully started `php@7.1` (label: homebrew.mxcl.php@7.1)```. – mbo Aug 13 '19 at 13:23
  • Thanks for your reaction. I did. Also runed ```brew install php71``` and started the php71. ```MacBook-Pro:applications mblivier$ brew services start php@7.1 ==> Successfully started `php@7.1` (label: homebrew.mxcl.php@7.1)```. But when i ask ```php -v``` i comes back with ```-bash: /usr/local/bin/php: No such file or directory```. Is there something i did wrong? – mbo Aug 13 '19 at 13:29
0

This is answer for your comment, I can't post as comment, need to post because is length limited.

There is one of two things going on here, either you didn't install PHP, or PHP is installed and not currently in any of system aware paths. First I would try to find PHP and make sure it exists:

$ find / -name php -type f

You should see something like:

/path/to/your/php/bin/php

If PHP binary does exist, check your path:

$ echo $PATH

If it does not exist, recompile php.

If PHP exists on your system, make sure the path to the /bin/php file is included. You can edit your ~/.bash_profile and add the custom path like this:

PATH=$PATH:/path/to/your/php/bin/
....  
export PATH

Then save and reload the file to ensure your current session has access to new path changes:

$ source ~/.bash_profile

With any luck you can now do a php -v and see the version response.

r00t-err0r
  • 174
  • 1
  • 11
  • root, Thanks for your reaction. I got php working. Thanks for the help so far. After this i ran in a other issue. I created a question for it as well. Do you also know the solution for this? thanks in advance! https://stackoverflow.com/questions/57494486/laravel-valet-wont-install – mbo Aug 14 '19 at 14:23