Unable to find pcntl on homebrew in mac high sierra - php

I have been trying to install pcntl extension using homebrew in MacOS High sierra using command
brew install homebrew/php/php71-pcntl
brew install homebrew-php/php71-pcntl
Also tried with php54, 55, 56, 70
I m getting error
Updating Homebrew...
Error: No available formula with the name "homebrew/php/php7-pcntl"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/php is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/php)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
Why its not finding the formulae on my Mac I have php 7.1.14 on my mac

In February and March 2018 the PHP formulas for the currently supported PHP versions (5.6, 7.0, 7.1, 7.2 at the moment of this writing) were moved to the core Homebrew tap and in April 2018 the PHP tap has been archived.
To install the current PHP version (7.2) use:
$ brew install php
To install one of the other supported versions use:
$ brew install php#5.6
(replace 5.6 with 7.0 or 7.1 for the other versions).
All the formulas installed this way contain the pcntl extension, there is no need for anything else.

Related

How can I install php7.1 using brew in 2020

I refered to some tutorials in google, but they do not work, I guess those methods are outdated.
eg https://developerjack.com/blog/2016/installing-php71-with-homebrew/
I got error when I run "brew install php#7.1"
macOS Catalina 10.15.4
executed
brew install
brew tap
caskroom/cask
homebrew/bundle
homebrew/cask
homebrew/core
homebrew/services
mongodb/brew
brew -v
Homebrew 2.2.12
Homebrew/homebrew-core (git revision 53ccd; last commit 2020-04-08)
Homebrew/homebrew-cask (git revision 322a2; last commit 2020-04-08)
brew install php#7.1
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.
Error: No available formula with the name "php#7.1"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
Up until the end of March 2018, all PHP related brews were handled by Homebrew/php tab, but that has been deprecated, so now we use what's available in the Homebrew/core package. This should be a better maintained, but is a much less complete, set of packages.
PHP 5.6, PHP 7.0, and PHP 7.1 have been deprecated and removed from Brew because they are out of support, and while it's not recommended for production, there are legitimate reasons to test these unsupported versions in a development environment.
Remember only PHP 7.2 through 7.4 are officially supported by Brew so if you want to install PHP 5.6, PHP 7.0, or PHP 7.1 you will need to add this tap:
$ brew tap shivammathur/php
Reference here
PHP#7.1 is deprecated https://www.php.net/supported-versions.php.
So try to install with other repo
brew install openldap libiconv
brew tap exolnet/homebrew-deprecated
brew install php#7.1
https://devhoi.com/threads/install-brew-deprecated-php-version-php-7-1-5-6-7-0-on-brew-macos.25/

How to overcome the "dyld: Library not loaded:" error when installing PHP on Mac?

I'm trying to install the latest version of PHP on my Mac. I tried this
brew install php72 --force
and then wanted to check the version, but got this error
localhost:regagents davea$ php --version
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/Cellar/php72/7.2.1_12/bin/php
Reason: image not found
Abort trap: 6
so I figured I could re-install readline, so I think I did ...
localhost:regagents davea$ brew reinstall readline
==> Reinstalling readline
==> Downloading https://homebrew.bintray.com/bottles/readline-8.0.0.high_sierra.bottle.tar.gz
Already downloaded: /Users/davea/Library/Caches/Homebrew/downloads/c0566e677ba9f92c270590e2d8132f95668817a7817d2ee47711ff3c2ff045d6--readline-8.0.0.high_sierra.bottle.tar.gz
==> Pouring readline-8.0.0.high_sierra.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides the BSD libedit library, which shadows libreadline.
In order to prevent conflicts when programs look for libreadline we are
defaulting this GNU Readline installation to keg-only.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
==> Summary
🍺 /usr/local/Cellar/readline/8.0.0: 48 files, 1.5MB
but then running "php -version" gives me the same error. What gives? How do I install and run php on my Mac?
Your older version of php is linked against readline 7. You have readline 8. Update php: the latest version of the php72 package in homebrew is 7.2.17_1.
brew update
brew upgrade php72
php 7.3.4 is available from the php package. To install the latest version of php:
brew install php

Install mcrypt extension for php with Homebrew in Mac High Sierra

I've been trying to install mcrypt extension for php 5.6 with the next commands:
brew install php56-mcrypt
with no results, I'm getting this error:
No available formula with the name "php56-mcrypt"
taken from questions like these:
Installing mcrypt on OSX 10.8.2 - PHP 5.3.15 with homebrew
According with this issue opened at Github:
https://github.com/Homebrew/homebrew-php/issues/4721
this way seemed was valid until March 2018, and now there's a new formula that I haven't been able to figure out.
Any advice will be appreciated

Install PHP Extension for PHP 5.6 on OSX with deprecated homebrew/php

today I've update Brew and now I can't install the php56-extensions.
On my Mac is installed "php56" and today I had need to install, "php56-redis", but when I had try to install this extension, Brew returned the following error message.
$ brew install php56-redis
Error: No available formula with the name "php56-redis"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
==> Searching local taps...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
I see on homebrew/php page that this "tap" is deprecated and for now only PHP engine are migrated on php#5.6 but the extensions not works.
First install exolnet/homebrew-deprecated
$ brew tap exolnet/homebrew-deprecated
After it install deprecated package
$ brew install php#5.6
I've found a solution to use old version of homebrew/php on my Mac.
Step 1
Go to last valid release of homebrew/php for php56
https://github.com/Homebrew/homebrew-php/tree/966f6c318be2d80b4953cd8cdc112b9611eff8d9
and download the Zip file.
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
Step 2
Go to
/usr/local/Homebrew/Library/Taps/homebrew/
and rename the Tap
homebrew-php
in
old-homebrew-php
Step 3
Unzip
homebrew-php-966f6c318be2d80b4953cd8cdc112b9611eff8d9.zip
in
/usr/local/Homebrew/Library/Taps/homebrew/
and rename folder in
homebrew-php
Step 4
Search your php extension with brew:
$ brew search php56-redis
==> Searching local taps...
homebrew/php/php56-redis
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...
Step 5
Install pakages without updates:
HOMEBREW_NO_AUTO_UPDATE=1 brew install homebrew/php/<formula>
This will stop the homebrew update for this command. If you want to prevent auto update for your shell session, use:
export HOMEBREW_NO_AUTO_UPDATE=1
to set it permanently, add it to your ~/.bash_profile.
Now at 2022, I only found https://github.com/shivammathur/homebrew-php to be still working.
See Error while doing `brew tap exolnet/homebrew-deprecated`
EDIT:
As it turned out, that you might also need legacy mysql 5.7 together with the ancient php, I ended up using lando (based on docker) to get it up running. This is my .lando.yml:
name: app
recipe: drupal6 # pulls also composer and drush as a colateral, any other php 5.6 application will work never the less
config:
php: '5.6'
database: mysql:5.7
webroot: .
Greetings to my fellow archeologists ;)

Cant find php72-pdo-pgsql / PostgreSQL driver for PHP using brew

I'm using PHP 7.2.3 installed using homebrew, and I want to install PostgreSQL driver for my PHP.
I tried to search the driver using homebrew search
jeremy#mbp ~ brew search php72-pdo-pgsql
==> Searching local taps...
==> Searching taps on GitHub...
==> Searching blacklisted, migrated and deleted formulae...
No formula found for "php72-pdo-pgsql".
Closed pull requests:
enchant 2.2.0 (https://github.com/Homebrew/homebrew-core/pull/21807)
Add PHP 7.2.0-alpha.1 core formula (php72) (https://github.com/Homebrew/homebrew-php/pull/4211)
I tried brew update && brew upgrade but I still can't find the PostgreSQL driver for my version of PHP.
Also, I tried to search only with brew search pgsql, but none of the results is for my PHP version.
Here's my brew tap results
jeremy#mbp ~ brew tap
caskroom/cask
heroku/brew
homebrew/core
homebrew/dupes
homebrew/php
homebrew/services
And my brew version
jeremy#mbp ~ brew -v
Homebrew 1.5.10
Homebrew/homebrew-core (git revision c3a9a; last commit 2018-03-17)
Since php72 that is included in the package. So if you do now
brew install php you will get that included. Reference: https://github.com/Homebrew/homebrew-php/commit/8771c68f3ddfee62d9e97177449010c2968f91d1#commitcomment-27883803

Categories