Valet: Trouble installing [email protected] on Catalina

Created on 11 Jun 2020  ยท  7Comments  ยท  Source: laravel/valet

Clear description of your problem

Valet no longer installs PHP versions below 7.2 using the valet use command. If PHP 7.1 is installed via an alternate tap (brew tap exolnet/homebrew-deprecated), valet/nginx responds with a 502.

Steps to Reproduce

  1. Install Homebrew, Composer, Valet
  2. valet use [email protected]

Output of these steps

Error: No available formula with the name "[email protected]" 
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
Error: No similarly named formulae found.
==> Searching taps on GitHub...
==> Searching for similarly named formulae...
==> Searching taps...
Error: No formulae found in taps.


In Brew.php line 140:

  Brew was unable to install [[email protected]].  


use <phpVersion>

Possible solution

Not sure. But, maybe Valet could host a tap that contains working versions of the deprecated PHP versions?

Diagnosis


sw_vers

ProductName:   Mac OS X
ProductVersion: 10.15.5
BuildVersion:   19F101



valet --version

Laravel Valet 2.10.3



cat ~/.config/valet/config.json

{
    "tld": "fsedev",
    "paths": [
        "/Users/justenholter/.config/valet/Sites"
    ]
}



cat ~/.composer/composer.json

{
    "require": {
        "laravel/valet": "^2.10"
    }
}



composer global diagnose

Changed current directory to /Users/justenholter/.composer
Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: OK
Composer version: 1.10.7
PHP version: 7.2.31
PHP binary path: /usr/local/Cellar/[email protected]/7.2.31_1/bin/php
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020



composer global outdated

Changed current directory to /Users/justenholter/.composer



ls -al /etc/sudoers.d/

total 16
drwxr-xr-x   4 root  wheel   128 Jun 10 21:36 .
drwxr-xr-x  85 root  wheel  2720 Jun 10 21:36 ..
-rw-r--r--   1 root  wheel    80 Jun 10 14:10 brew
-rw-r--r--   1 root  wheel    83 Jun 10 14:10 valet



brew config

HOMEBREW_VERSION: 2.4.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 28ed0801ed5807e176e62a3ba66e47ec867ec17d
Last commit: 5 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: fd2152a57a6a26b51e5a391f9efddadb4ea5b5d0
Core tap last commit: 63 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_MAKE_JOBS: 8
CPU: octa-core 64-bit icelake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1103
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.5-x86_64
CLT: 1103.0.32.62
Xcode: N/A



brew services list

Name      Status  User         Plist
dnsmasq   started root         /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
[email protected] started justenholter /Users/justenholter/Library/LaunchAgents/[email protected]
nginx     started root         /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php       stopped              
[email protected]   stopped



brew list --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d..*)?\s"

curl-openssl 7.70.0
dnsmasq 2.81
[email protected] 5.7.29
nginx 1.19.0
[email protected] 1.1.1g
php 7.4.6_1
[email protected] 7.2.31_1



brew outdated





php -v

PHP 7.2.31 (cli) (built: May 29 2020 02:00:47) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.31, Copyright (c) 1999-2018, by Zend Technologies



which -a php

/usr/local/opt/[email protected]/bin/php
/usr/bin/php



php --ini

Configuration File (php.ini) Path: /usr/local/etc/php/7.2
Loaded Configuration File:         /usr/local/etc/php/7.2/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.2/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.2/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.2/conf.d/php-memory-limits.ini



nginx -v

nginx version: nginx/1.19.0



curl --version

curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets



php --ri curl

curl

cURL support => enabled
cURL Information => 7.70.0
Age => 6
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin19.4.0
SSL Version => OpenSSL/1.1.1g
ZLib Version => 1.2.11
libSSH Version => libssh2/1.9.0



~/.composer/vendor/laravel/valet/bin/ngrok version

ngrok version 2.3.35



ls -al ~/.ngrok2

ls: /Users/justenholter/.ngrok2: No such file or directory



brew info nginx

nginx: stable 1.19.0 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.19.0 (25 files, 2.1MB) *
  Poured from bottle on 2020-06-10 at 20:02:58
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/nginx.rb
==> Dependencies
Required: [email protected], pcre
==> Options
--HEAD
    Install HEAD version
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  nginx
==> Analytics
install: 36,162 (30 days), 104,594 (90 days), 411,701 (365 days)
install-on-request: 35,071 (30 days), 101,343 (90 days), 396,412 (365 days)
build-error: 0 (30 days)



brew info php

php: stable 7.4.6 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/php/7.4.6_1 (520 files, 76.1MB)
  Poured from bottle on 2020-06-10 at 19:59:38
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb
==> Dependencies
Build: httpd, pkg-config
Required: apr, apr-util, argon2, aspell, autoconf, curl-openssl, freetds, freetype, gettext, glib, gmp, icu4c, jpeg, libffi, libpng, libpq, libsodium, libzip, oniguruma, openldap, [email protected], sqlite, tidy-html5, unixodbc, webp
==> Options
--HEAD
    Install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so

    
        SetHandler application/x-httpd-php
    

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/7.4/

To have launchd start php now and restart at login:
  brew services start php
Or, if you don't want/need a background service you can just run:
  php-fpm
==> Analytics
install: 52,229 (30 days), 146,403 (90 days), 509,798 (365 days)
install-on-request: 49,376 (30 days), 137,300 (90 days), 472,966 (365 days)
build-error: 0 (30 days)



brew info openssl

[email protected]: stable 1.1.1g (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/[email protected]/1.1.1g (8,059 files, 18MB)
  Poured from bottle on 2020-06-10 at 16:47:28
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/[email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/[email protected]/certs

and run
  /usr/local/opt/[email protected]/bin/c_rehash

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

==> Analytics
install: 732,811 (30 days), 2,353,538 (90 days), 5,804,882 (365 days)
install-on-request: 103,895 (30 days), 354,653 (90 days), 790,476 (365 days)
build-error: 0 (30 days)



openssl version -a

LibreSSL 2.8.3
built on: date not available
platform: information not available
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx) 
compiler: information not available
OPENSSLDIR: "/private/etc/ssl"



openssl ciphers

ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:GOST2012256-GOST89-GOST89:DHE-RSA-CAMELLIA256-SHA256:DHE-RSA-CAMELLIA256-SHA:GOST2001-GOST89-GOST89:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:CAMELLIA256-SHA256:CAMELLIA256-SHA:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA256:DHE-RSA-CAMELLIA128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:CAMELLIA128-SHA256:CAMELLIA128-SHA:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:RC4-SHA:RC4-MD5:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA



sudo nginx -t

nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful



which -a php-fpm

/usr/local/opt/[email protected]/sbin/php-fpm
/usr/sbin/php-fpm



/usr/local/opt/php/sbin/php-fpm -v

PHP 7.4.6 (fpm-fcgi) (built: May 29 2020 01:45:08)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies



sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/7.2/php-fpm.conf --test

[11-Jun-2020 07:50:47] NOTICE: configuration file /usr/local/etc/php/7.2/php-fpm.conf test is successful



ls -al ~/Library/LaunchAgents | grep homebrew

-rw-r--r--   1 justenholter  staff   551 Jun 10 22:05 [email protected]
-rw-r--r--   1 justenholter  staff   636 Jun 10 15:30 [email protected]



ls -al /Library/LaunchAgents | grep homebrew





ls -al /Library/LaunchDaemons | grep homebrew

-rw-r--r--   1 root  admin   657 Jun 10 22:20 homebrew.mxcl.dnsmasq.plist
-rw-r--r--   1 root  admin   571 Jun 10 22:27 homebrew.mxcl.nginx.plist

Most helpful comment

(for the leftover plist file you could just rm it; but of course since you're trying to actually install that PHP version maybe it's moot)

The next problem you're having is that now homebrew is trying to install PHP from a precompiled edition, based on other dependencies that were available at the time that precompiled zip was generated. But many of those dependencies, particularly the icu4c v64 package files (and likely also [email protected]), are no longer available.

eg:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
  Referenced from: /usr/local/Cellar/[email protected]/7.1.33/bin/php
  Reason: image not found

("image not found" means "file not found" ... referring to the icu4c dylib file)
(akin to Windows "dll not found")

Again, it's the precompiled [email protected]/7.1.33/bin/php binary that's looking for that icu4c/lib/libicui18n.64.dylib file, because it's assuming it's present because that's the version that was present on the system doing the compiling initially.

While sometimes these "image not found" cases can be resolved by manually symlinking a bunch of files, it's probably best in this case to compile 7.1 from source.

You "might" get away with forcing a re-install of (in this case "older") dependencies with:
brew install [email protected] --only-dependencies

But a full recompile from-source can be done via:

brew remove [email protected]
brew install [email protected] --build-from-source

If all that works without triggering dyld errors then valet use [email protected] should get Valet to switch over to using 7.1

All 7 comments

Thanks for including the valet diagnose output.

Your 502 is simply because Nginx has been told to use a PHP version that's not started. You can see in brew services list that neither of your two PHP versions (7.4, 7.2) is running.
(Of course, this is a result of use [email protected] not completing properly, and thus not restarting any of the services. Running valet use [email protected] will restart 7.2 and reset the configs to use it.)

It appears that on your device tapping the exolnet repo didn't work properly. The [email protected] formula is indeed in that repo (you can see it here: https://github.com/eXolnet/homebrew-deprecated/tree/master/Formula)

What's the output of brew tap?
I get:

> brew tap
exolnet/deprecated
homebrew/bundle
homebrew/cask
homebrew/cask-fonts
homebrew/cask-versions
homebrew/core
homebrew/services

Also, what's the output of brew info [email protected]?
I get:

> brew info [email protected]
exolnet/deprecated/[email protected]: stable 7.1.33 [keg-only]
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/[email protected]/7.1.33 (64B)
  Built from source
From: https://github.com/exolnet/homebrew-deprecated/blob/master/Formula/[email protected]
...

Note: installing old versions such as 7.1 triggers a "build from source" re-compiling of PHP, which can take quite awhile (expect 10-15 minutes or so).
(You can trigger the manual install via brew install [email protected] if tapping the exolnet repo works.)

Aside: I see in your diagnostics data that you have a leftover LaunchAgent plist you may want to delete: ~/Library/LaunchAgents/[email protected] because it doesn't point to any currently installed package.

maybe Valet could host a tap that contains working versions of the deprecated PHP versions?

Not likely going to happen. I've seen others do that and it just adds more maintenance complexity. Plus, eXolnet keeps theirs up to date quite consistently.

@drbyte Appreciate your quick and thorough response! Very appreciated!

I'm going through the steps to re-install [email protected] via Brew using Valet use. Below are the steps so far, including the requested output & latest diagnostic info.

Admittedly, I've also been tinkering with this for the last day. I've been installing and uninstalling everything over, and over, again hoping for a different result! This is probably how the leftover LaunchAgent plist is sitting around (Not sure what to do about that).

1. I've tapped the exolnet repo brew tap exolnet/deprecated

justenholter@MacBook-Pro Cellar % brew tap
exolnet/deprecated
homebrew/cask
homebrew/core
homebrew/services

2. I run valet use [email protected]

valet use [email protected] 
Stopping [email protected]...
Installing [email protected]...
[[email protected]] is not installed, installing it now via Brew... ๐Ÿป
==> Installing [email protected] from exolnet/deprecated
==> Downloading https://dl.bintray.com/exolnet/bottles-deprecated/php%407.1-7.1.33.catalina.bottle.1.tar.gz
Already downloaded: /Users/justenholter/Library/Caches/Homebrew/downloads/f8a63db8b82614f57691f6a803a7a64b916376175a61ce4dcd41f9e1622a9099--php@7.1-7.1.33.catalina.bottle.1.tar.gz
==> Pouring [email protected]
==> /usr/local/Cellar/[email protected]/7.1.33/bin/pear config-set php_ini /usr/local/etc/php/7.1/php.ini system
Last 15 lines from /Users/justenholter/Library/Logs/Homebrew/[email protected]/post_install.01.pear:
2020-06-11 08:31:38 -0500

/usr/local/Cellar/[email protected]/7.1.33/bin/pear
config-set
php_ini
/usr/local/etc/php/7.1/php.ini
system

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
  Referenced from: /usr/local/Cellar/[email protected]/7.1.33/bin/php
  Reason: image not found
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall exolnet/deprecated/[email protected]`
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/7.1/

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"


To have launchd start exolnet/deprecated/[email protected] now and restart at login:
  brew services start exolnet/deprecated/[email protected]
Or, if you don't want/need a background service you can just run:
  php-fpm
==> Summary
๐Ÿบ  /usr/local/Cellar/[email protected]/7.1.33: 515 files, 62.9MB


In Brew.php line 140:

  Brew was unable to install [[email protected]].  


use <phpVersion>

3. Output of brew info [email protected] post install attempt

brew info [email protected]
exolnet/deprecated/[email protected]: stable 7.1.33 (bottled) [keg-only]
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/[email protected]/7.1.33 (515 files, 62.9MB)
  Poured from bottle on 2020-06-11 at 08:31:37
From: https://github.com/exolnet/homebrew-deprecated/blob/master/Formula/[email protected]
==> Dependencies
Build: httpd โœ˜, pkg-config โœ˜
Required: apr โœ”, apr-util โœ”, aspell โœ”, autoconf โœ”, curl-openssl โœ”, freetds โœ”, freetype โœ”, gettext โœ”, glib โœ”, gmp โœ”, icu4c โœ”, jpeg โœ”, libpng โœ”, libpq โœ”, libtool โœ”, libzip โœ”, mcrypt โœ”, openldap โœ”, [email protected] โœ”, sqlite โœ”, tidy-html5 โœ”, unixodbc โœ”, webp โœ”
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/7.1/

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
  echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"


To have launchd start exolnet/deprecated/[email protected] now and restart at login:
  brew services start exolnet/deprecated/[email protected]
Or, if you don't want/need a background service you can just run:
  php-fpm

Diagnostic


sw_vers

ProductName:   Mac OS X
ProductVersion: 10.15.5
BuildVersion:   19F101



valet --version

Laravel Valet 2.10.3



cat ~/.config/valet/config.json

{
    "tld": "fsedev",
    "paths": [
        "/Users/justenholter/.config/valet/Sites"
    ]
}



cat ~/.composer/composer.json

{
    "require": {
        "laravel/valet": "^2.10"
    }
}



composer global diagnose

Changed current directory to /Users/justenholter/.composer
Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: OK
Composer version: 1.10.7
PHP version: 7.2.31
PHP binary path: /usr/local/Cellar/[email protected]/7.2.31_1/bin/php
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020



composer global outdated

Changed current directory to /Users/justenholter/.composer



ls -al /etc/sudoers.d/

total 16
drwxr-xr-x   4 root  wheel   128 Jun 10 21:36 .
drwxr-xr-x  85 root  wheel  2720 Jun 10 21:36 ..
-rw-r--r--   1 root  wheel    80 Jun 10 14:10 brew
-rw-r--r--   1 root  wheel    83 Jun 10 14:10 valet



brew config

HOMEBREW_VERSION: 2.4.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 28ed0801ed5807e176e62a3ba66e47ec867ec17d
Last commit: 5 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: fd2152a57a6a26b51e5a391f9efddadb4ea5b5d0
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_MAKE_JOBS: 8
CPU: octa-core 64-bit icelake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1103
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.5-x86_64
CLT: 1103.0.32.62
Xcode: N/A



brew services list

Name      Status  User         Plist
dnsmasq   started root         /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
[email protected] started justenholter /Users/justenholter/Library/LaunchAgents/[email protected]
nginx     started root         /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php       stopped              
[email protected]   started justenholter /Users/justenholter/Library/LaunchAgents/[email protected]
[email protected]   stopped



brew list --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d..*)?\s"

curl-openssl 7.70.0
dnsmasq 2.81
[email protected] 5.7.29
nginx 1.19.0
[email protected] 1.1.1g
php 7.4.6_1
[email protected] 7.1.33
[email protected] 7.2.31_1



brew outdated





php -v

PHP 7.2.31 (cli) (built: May 29 2020 02:00:47) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.31, Copyright (c) 1999-2018, by Zend Technologies



which -a php

/usr/local/opt/[email protected]/bin/php
/usr/local/opt/[email protected]/bin/php
/usr/local/opt/[email protected]/bin/php
/usr/local/bin/php
/usr/local/opt/[email protected]/bin/php
/usr/local/opt/[email protected]/bin/php
/usr/local/opt/[email protected]/bin/php
/usr/local/bin/php
/usr/local/bin/php
/usr/bin/php



php --ini

Configuration File (php.ini) Path: /usr/local/etc/php/7.2
Loaded Configuration File:         /usr/local/etc/php/7.2/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.2/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.2/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.2/conf.d/php-memory-limits.ini



nginx -v

nginx version: nginx/1.19.0



curl --version

curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets



php --ri curl

curl

cURL support => enabled
cURL Information => 7.70.0
Age => 6
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin19.4.0
SSL Version => OpenSSL/1.1.1g
ZLib Version => 1.2.11
libSSH Version => libssh2/1.9.0



~/.composer/vendor/laravel/valet/bin/ngrok version

ngrok version 2.3.35



ls -al ~/.ngrok2

ls: /Users/justenholter/.ngrok2: No such file or directory



brew info nginx

nginx: stable 1.19.0 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.19.0 (25 files, 2.1MB) *
  Poured from bottle on 2020-06-10 at 20:02:58
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/nginx.rb
==> Dependencies
Required: [email protected], pcre
==> Options
--HEAD
    Install HEAD version
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  nginx
==> Analytics
install: 36,162 (30 days), 104,594 (90 days), 411,701 (365 days)
install-on-request: 35,071 (30 days), 101,343 (90 days), 396,412 (365 days)
build-error: 0 (30 days)



brew info php

php: stable 7.4.6 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/php/7.4.6_1 (520 files, 76.1MB)
  Poured from bottle on 2020-06-10 at 19:59:38
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/php.rb
==> Dependencies
Build: httpd, pkg-config
Required: apr, apr-util, argon2, aspell, autoconf, curl-openssl, freetds, freetype, gettext, glib, gmp, icu4c, jpeg, libffi, libpng, libpq, libsodium, libzip, oniguruma, openldap, [email protected], sqlite, tidy-html5, unixodbc, webp
==> Options
--HEAD
    Install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so

    
        SetHandler application/x-httpd-php
    

Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /usr/local/etc/php/7.4/

To have launchd start php now and restart at login:
  brew services start php
Or, if you don't want/need a background service you can just run:
  php-fpm
==> Analytics
install: 52,229 (30 days), 146,403 (90 days), 509,798 (365 days)
install-on-request: 49,376 (30 days), 137,300 (90 days), 472,966 (365 days)
build-error: 0 (30 days)



brew info openssl

[email protected]: stable 1.1.1g (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/[email protected]/1.1.1g (8,059 files, 18MB)
  Poured from bottle on 2020-06-10 at 16:47:28
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/[email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/[email protected]/certs

and run
  /usr/local/opt/[email protected]/bin/c_rehash

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

==> Analytics
install: 732,811 (30 days), 2,353,538 (90 days), 5,804,882 (365 days)
install-on-request: 103,895 (30 days), 354,653 (90 days), 790,476 (365 days)
build-error: 0 (30 days)



openssl version -a

LibreSSL 2.8.3
built on: date not available
platform: information not available
options:  bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx) 
compiler: information not available
OPENSSLDIR: "/private/etc/ssl"



openssl ciphers

ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:GOST2012256-GOST89-GOST89:DHE-RSA-CAMELLIA256-SHA256:DHE-RSA-CAMELLIA256-SHA:GOST2001-GOST89-GOST89:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:CAMELLIA256-SHA256:CAMELLIA256-SHA:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA256:DHE-RSA-CAMELLIA128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:CAMELLIA128-SHA256:CAMELLIA128-SHA:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:RC4-SHA:RC4-MD5:ECDHE-RSA-DES-CBC3-SHA:ECDHE-ECDSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:DES-CBC3-SHA



sudo nginx -t

nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful



which -a php-fpm

/usr/local/opt/[email protected]/sbin/php-fpm
/usr/local/opt/[email protected]/sbin/php-fpm
/usr/local/opt/[email protected]/sbin/php-fpm
/usr/local/sbin/php-fpm
/usr/local/opt/[email protected]/sbin/php-fpm
/usr/local/opt/[email protected]/sbin/php-fpm
/usr/local/opt/[email protected]/sbin/php-fpm
/usr/local/sbin/php-fpm
/usr/sbin/php-fpm



/usr/local/opt/php/sbin/php-fpm -v

PHP 7.4.6 (fpm-fcgi) (built: May 29 2020 01:45:08)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.6, Copyright (c), by Zend Technologies



sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/7.2/php-fpm.conf --test

[11-Jun-2020 08:40:53] NOTICE: configuration file /usr/local/etc/php/7.2/php-fpm.conf test is successful



ls -al ~/Library/LaunchAgents | grep homebrew

-rw-r--r--   1 justenholter  staff   551 Jun 10 22:05 [email protected]
-rw-r--r--   1 justenholter  staff   636 Jun 10 15:30 [email protected]



ls -al /Library/LaunchAgents | grep homebrew





ls -al /Library/LaunchDaemons | grep homebrew

-rw-r--r--   1 root  admin   657 Jun 10 22:20 homebrew.mxcl.dnsmasq.plist
-rw-r--r--   1 root  admin   571 Jun 11 08:25 homebrew.mxcl.nginx.plist

(for the leftover plist file you could just rm it; but of course since you're trying to actually install that PHP version maybe it's moot)

The next problem you're having is that now homebrew is trying to install PHP from a precompiled edition, based on other dependencies that were available at the time that precompiled zip was generated. But many of those dependencies, particularly the icu4c v64 package files (and likely also [email protected]), are no longer available.

eg:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
  Referenced from: /usr/local/Cellar/[email protected]/7.1.33/bin/php
  Reason: image not found

("image not found" means "file not found" ... referring to the icu4c dylib file)
(akin to Windows "dll not found")

Again, it's the precompiled [email protected]/7.1.33/bin/php binary that's looking for that icu4c/lib/libicui18n.64.dylib file, because it's assuming it's present because that's the version that was present on the system doing the compiling initially.

While sometimes these "image not found" cases can be resolved by manually symlinking a bunch of files, it's probably best in this case to compile 7.1 from source.

You "might" get away with forcing a re-install of (in this case "older") dependencies with:
brew install [email protected] --only-dependencies

But a full recompile from-source can be done via:

brew remove [email protected]
brew install [email protected] --build-from-source

If all that works without triggering dyld errors then valet use [email protected] should get Valet to switch over to using 7.1

@drbyte Thank you! Installing from source did the trick.

It seems like the best order for installing [email protected] (or any deprecated version hosted by exolnet) for use with Valet would have gone something like this....

brew tap exolnet/deprecated
brew install [email protected] --build-from-source
valet use [email protected]

Note: --build-from-source was key to my success, and gets around the missing dependencies/libs. Thanks @drbyte!

Now I can enjoy my new laptop in peace!

@justenh I'm glad this helped you sort it out.

Perhaps you can update the title of this Issue to something like "Trouble installing [email protected] on Catalina" for clarity of original problem so future searchers can find it easily.

Thank you! @justenh This problem provided me with ideas for solving.
my error:

`
โžœ ~ valet use [email protected]

Installing [email protected]...
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 1 formula.
Updating Homebrew...
[[email protected]] is not installed, installing it now via Brew... ๐Ÿป
Note: older PHP versions may take 10+ minutes to compile from source. Please wait ...
Updating Homebrew...
Error: Formulae found in multiple taps:
* shivammathur/php/[email protected]
* exolnet/deprecated/[email protected]
Please use the fully-qualified name (e.g. shivammathur/php/[email protected]) to refer to the formula.
In Brew.php line 168:
Brew was unable to install [[email protected]].
use [--force] [--] []
`

โžœ ~ brew info [email protected]
Error: Formulae found in multiple taps:
* shivammathur/php/[email protected]
* exolnet/deprecated/[email protected]

Please use the fully-qualified name (e.g. shivammathur/php/[email protected]) to refer to the formula.`

I saw @justenh the list of brew tap associations in the solution, so I tried to remove the redundant associations.

โžœ ~ brew tap
exolnet/deprecated
homebrew/cask
homebrew/core
homebrew/services
josegonzalez/php
shivammathur/php
โžœ ~ brew untap shivammathur/php
Untapping shivammathur/php...
Untapped 8 formulae (78 files, 802.6KB).
โžœ ~ brew untap josegonzalez/php
Untapping josegonzalez/php...
Untapped (35 files, 28.2KB).

I run valet use [email protected]

โžœ ~ valet use [email protected]
Password:
Linking new version: [email protected]
Updating PHP configuration...
Restarting [email protected]...
Restarting nginx...
Valet is now using [email protected].

Note that you might need to run composer global update if your PHP version change affects the dependencies of global packages required by Composer.

โžœ ~ brew info [email protected]
exolnet/deprecated/[email protected]: stable 7.1.33 [keg-only]
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/[email protected]/7.1.33 (508 files, 63.1MB) *
Built from source on 2020-12-22 at 17:15:06
From: https://github.com/exolnet/homebrew-deprecated/blob/HEAD/Formula/[email protected]
==> Dependencies
Build: httpd โœ”, pkg-config โœ”
Required: apr โœ”, apr-util โœ”, aspell โœ”, autoconf โœ”, curl-openssl โœ”, freetds โœ”, freetype โœ”, gettext โœ”, glib โœ”, gmp โœ”, icu4c โœ”, jpeg โœ”, libpng โœ”, libpq โœ”, libtool โœ”, libzip โœ”, mcrypt โœ”, openldap โœ”, [email protected] โœ”, sqlite โœ”, tidy-html5 โœ”, unixodbc โœ”, webp โœ”
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

Finally, check DirectoryIndex includes index.php
DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
/usr/local/etc/php/7.1/

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

To have launchd start exolnet/deprecated/[email protected] now and restart at login:
brew services start exolnet/deprecated/[email protected]
Or, if you don't want/need a background service you can just run:
php-fpm

Valet uses shivammathur/php, not exolnet/deprecated, and will attempt to re-tap shivammathur/php next time you switch PHP versions.
Best to brew untap exolnet/deprecated before trying to change PHP versions again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alshie picture Alshie  ยท  4Comments

Flimm picture Flimm  ยท  5Comments

webartistse picture webartistse  ยท  4Comments

dustinleblanc picture dustinleblanc  ยท  4Comments

AlexVipond picture AlexVipond  ยท  4Comments