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

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

Related

Error upgrading PHP 7.4 on MAC after Brew installation

I have a Mac Air with Ventura OS.
I just installed Brew and after that I can't upgrade PHP anymore.
I get the following error:
Error: php#7.4 has been disabled because it is a versioned formula!
How can I solve it?
New to MacOS and Brew.
Thanks
Fabio
No clue what to do at this point.
The message tells you that PHP 7.4 is outdated. You can either install PHP8
brew install php
or link a 3rd party repository and install 7.4 from there.
For example:
brew tap shivammathur/php
brew install shivammathur/php/php#7.4
brew link php#7.4

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

Homebrew upgrade drops PHP: dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib

Today I upgraded Homebrew and this causes PHP versions (7.2 - 7.3) to be dropped. the following error is shown whenever I try to reinstall them:
dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib
Referenced from: /usr/local/opt/curl-openssl/bin/curl
Reason: image not found
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "php"
Download failed: https://www.php.net/distributions/php-7.3.9.tar.xz
Any suggestions?
Okay, I've solved this by installing this library brew install libpsl
then reinstall php brew reinstall php#7.2 --build-from-source
also the same for php#7.3
Be aware that reinstalling php will reset all php configurations
It's a bug after php was migrated to OpenSSH 1.1. There's no need to install libpsl.
The problem has been fixed by pr-44048. You should uninstall libpsl and reinstall php.
brew uninstall libpsl
brew reinstall php
Removing the Cellar folder and installing the PHP again worked for me.
rm -rf /Users/rafaelgomes/.composer/*
rm -rf /usr/local/Cellar/*
brew doctor ; brew update ; brew upgrade
brew install php
I've solved this by doing the following
brew uninstall libpsl
brew remove php
brew install libpsl
brew install php#8.0

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

mcrypt after homebrew install

I'm attempting to put together a new laravel application and tried to run php artisan to get the list of commands and it says MCrypt extention required. I am running on OSX Mavericks and ran the mrypt installation from homebrew. So now I"m stuck trying to figure out what I need to do. I am trying to get it ready so I can start messing with Vagrant.
I did go through the commands here through terminal:
brew install libjpeg
brew install pcre
brew install libxml2
brew install mcrypt
So now I'm trying to figure out why its not letting me run other commands and needing mycrpt enabled even though I already installed it.
I did the suggestions below and still when I try and run php artisan it says mycrypt php extention required.
Any ideas?
Assuming php 5.5:
brew install php55-mcrypt
If it doesn't find it:
brew tap josegonzalez/php
brew install php55-mcrypt
If it complains about not having zlib:
brew tap homebrew/dupes
brew tap josegonzalez/php
brew install php55-mcrypt
If you're on a different version of php, just change the php55 to match (php 5.3? brew install php53-mcrypt)

Categories