Uninstall Laravel Valet - php

I installed Valet for the first time and I had some problems listed below:
It throws an error saying:
Unable to determine linked PHP.
Even though I have PHP 7.1 installed by php-osx.liip.ch so it just goes ahead and installs PHP 7.0 with homebrew anyway!
In the non-laravel projects my localhost does not work and it responds:
ERR_EMPTY_RESPONSE
and then Valet itself does not work either!
I'm getting an error on Valet domains with message:
This site can’t be reached laravel_from_scratch.dev’s server DNS
address could not be found.
So I decided to uninstall it by running $ valet uninstall, it returns the corresponding response but then when I'm running $ valet it is all there! How to uninstall it correctly?
BTW, I posted this issue also on the Valet GitHub page.

I guess I find the solution after a little bit playing around.
It seems Valet uninstall command does not work as expected. To uninstall it first run the composer command to uninstall the php dependencies:
$ composer global remove laravel/valet
then to uninstall the dependencies installed with the Homebrew, first run;
$ brew list
just so you know we are in the same page then if you see dnsmasq and php70 in case you do not want them or you have php7 installed in another approach (like me) run:
$ brew uninstall dnsmasq
and
$ brew uninstall php70
Then go to your user directory and delete the .valet hidden directory or run the terminal command like so:
$ sudo rm -r ~/.valet

An official response here:
https://github.com/laravel/valet/issues/341#issuecomment-287048987
valet uninstall --force
sudo brew services stop nginx
sudo brew services stop php70
sudo brew services stop dnsmasq
brew uninstall nginx
brew uninstall php70
brew uninstall dnsmasq
rm -rf ~/.valet
rm /usr/local/bin/valet

Related

Homebrew: How install disabled package(php7.1)?

I try to install php7.1 (via command brew install php#7.1) for my work-project on my new macbook, but i got following message:
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
I can't reject using php7.1 because it requirement of my work.
How can I install php7.1 on MacOS?
Start by making sure brew is up-to-date:
brew update
Normal upgrade
brew upgrade PHP
Normal upgrade does not work in many macOS old Versions.
Upgrade with shivammathur/homebrew-php
brew tap shivammathur/php
brew install shivammathur/php/php#7.1
To switch between versions, use the following command:
brew link --overwrite --force php#7.1
Next steps
Check the current version by running php -v:
If you can then, Restart Nginx or Apache also:
refer Link

Error when install PHP with brew in OS Monterey

I got php is deleted in OS Monterey, so I try to install it via Homebrew
I already install Homebrew, update tap to shivammathur/php and use this command
brew install shivammathur/php/php#7.4
but I got this response code
fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "httpd" (dependency of shivammathur/php/php#7.4).
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
When I check brew version with brew --version I got this info
Homebrew 3.3.2
Homebrew/homebrew-core (no Git repository)
Homebrew/homebrew-cask (git revision 5c43c2133d; last commit 2021-11-06)
is that no Git repository issue related with why I cant install php in my device? How to solve this issue
I need this to install composer and install Laravel, so install XAMPP I think is not clear solution right now
Thankyou
I recently had this exact problem and tried
brew tap homebrew/core
However, it didn't work. This did work for me
rm -rf $(brew --repo homebrew/core)
brew tap homebrew/core
brew install php
Hope this helps!
As the output of brew --version says homebrew-core repository is missing, that is why brew is not able to find httpd.
Homebrew/homebrew-core (no Git repository)
Please tap the core repository and try again.
brew tap homebrew/core
Try write this in terminal:
git -C $(brew --repository homebrew/core) checkout master

OSX Sierra - How to Install PHP7 and leave 5.6 as default in Terminal

short question - how to install php7.1 on OS X Sierra and keep 5.6 as default.
I only want to run php 7.1 in terminal using php7 - and when using php the original 5.6 should be used ...
thanx in advance
tom
There are a number of ways to achieve this. I would install PHPBrew, since that allows you install as many PHP versions as you want without touching the system's PHP version.
I would also install Homebrew as it's likely there will be dependencies you need to resolve with specific extensions.
Another option would be to install PHP7 via Homebrew and alias it to php7. Or you could compile it from source. However, if you plan on having one or more PHP versions readily available alongside the system version then PHPBrew is probably the most flexible option.
Install PHP 5.6:
brew install php56
Install PHP 7.0:
php70
Switch to php5.6 in terminal:
brew unlink php70
brew link php56
Switch to php7.0 in terminal:
brew unlink php56
brew link php70
Source: Switching PHP version on mac with homebrew
maybe someone other is searching for a very clean solution too - here is what finally worked for me perfectly. this is based on the hints and tips from matthew daly and surfer 190 - thanx again!
takes just 5 minutes - here we go ...
first install xcode command line tools (just 160mb instead 4.5gb):
xcode-select --install
then install homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
short test if anything up to here is fine:
brew doctor
install php 7.1:
brew install php71
i found that some have problems with the above direct php install - this resolves these problems - and then try again the php install:
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
make a symlink to the original php-binary that came with osx:
ln -s /usr/bin/php /usr/local/bin/php5
here is the result - now php 7.1 is the default php version - and using php5 will use the old php-binary that came with your osx preinstalled:
php -v
php5 -v

error when starting mysql with brew

I'm starting to learn PHP Laravel, I reached the valet installation and came to the point where I need to install mysql with brew with this command
brew install mysql
the mysql installation is done successfully, However when I run the command
brew services start mysql
I get this error that I couldn't find a solution for
sh: 1: list: not found
Error: Failure while executing: load -w
/home/chemseddinez/Library/LaunchAgents/homebrew.mxcl.mysql.plist
PS: I'm using ubuntu 16.04 LTS
brew services only works with macOS' launchctl manager. You can start mysql manually using $(brew --prefix)/bin/mysql.server.
Or you can just install apt-get install mysql-server and launch it as daemon via systemctl start mysql.

Missing PHP53 or PHP54 from homebrew-php

With this command
$ brew install josegonzalez/php/composer
I get this message
Missing PHP53 or PHP54 from homebrew-php. Please install one or the other before continuing
Error: An unsatisfied requirement failed this build.
I have MacOsX 10.7 with MAMP. Can someone help me?
If you have already php installed, you can ignore the dependencies by --ignore-dependencies parameter in example:
brew install composer --ignore-dependencies
Or if you don't have php, you'll have to install first via:
brew install php55
I use OSX 10.9 and use XAMPP.
I also have this problem.
But I use brew install php, and then install composer successfully.
brew install php54
update
or
brew install php55
Are you seeing this warning?
Warning: No developer tools installed.
Install the Command Line Tools:
xcode-select --install
If so, it might fix your issue:
xcode-select --install
brew install php55
brew install composer
It worked for me. Warning, the xcode-select install takes a long time.
I had this issue when doing brew intsall php-cs-fixer I upgraded PHP from 5.4.14 to 5.4.16 via Homebrew (maybe try reinstalling if you are already up-to-date) and removed multiple paths to PHP in my PATH Environment variable. Not sure which bit fixed it for me, but it now works correctly.
Also I was advised to try brew install --env-std php-cs-fixer in the Homebrew IRC channel, it did not work for me, but might do for others.
Hope that helps anyone with the same issue!
I get the same problem with brew, I suggest to install it manually with:
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar

Categories