Valet: Not support php 8.0

Created on 23 Dec 2020  路  9Comments  路  Source: laravel/valet

valet use [email protected]

Valet doesn't support PHP version: php@8 (try something like '[email protected]' instead)

Most helpful comment

You can probably fix that by running: brew unlink [email protected] and then valet use php.
Since you also already have PHP8 installed, if the above isn't enough, then also run: brew link php or brew link [email protected].

All 9 comments

You're probably using an old Valet version.

composer self-update

Probably also good to brew upgrade

Then composer global update or composer global require laravel/valet to get the latest version.

Then valet install

Then you can valet use [email protected] or just valet use php (since 8.0 is latest currently)

I am still getting following errors:

image
image
image

Those messages report that you've locked composer to use or act as PHP 5.6.36, probably with a setting in your global composer.json file.

It's hard to help with your machine-specific problems when you skip the posting-instructions like you did when you opened this issue.
Please run valet diagnose and post the output here.


sw_vers

ProductName:   Mac OS X
ProductVersion: 10.15.7
BuildVersion:   19H2



valet --version

Deprecated: Required parameter $all follows optional parameter $domain in /Users/macbook/.composer/vendor/laravel/valet/cli/valet.php on line 168
PHP Deprecated:  Required parameter $all follows optional parameter $domain in /Users/macbook/.composer/vendor/laravel/valet/cli/valet.php on line 168
Laravel Valet 2.11.0



cat ~/.config/valet/config.json

{
    "tld": "test",
    "paths": [
        "/Users/macbook/.config/valet/Sites"
    ]
}



cat ~/.composer/composer.json

{
    "require": {
        "laravel/valet": "^2.10",
        "laravel/envoy": "^2.3",
        "laravel/installer": "^4.1"
    },
    "config": {
        "platform": {
            "php": "5.6.36"
        }
    }
}



composer global diagnose

Changed current directory to /Users/macbook/.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: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.0.8
PHP version: 5.6.36 - Package overridden via config.platform, actual: 8.0.0
PHP binary path: /usr/local/Cellar/php/8.0.0_1/bin/php
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020
cURL version: 7.74.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/1.1.1i
zip: extension present, unzip present



composer global outdated

Changed current directory to /Users/macbook/.composer
doctrine/inflector            2.0.3   ~ v1.1.0   PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
guzzlehttp/guzzle             7.2.0   ~ 6.5.5    Guzzle is a PHP HTTP client library
illuminate/container          v7.28.4 ~ v5.4.36  The Illuminate Container package.
illuminate/contracts          v7.28.4 ~ v5.4.36  The Illuminate Contracts package.
illuminate/support            v7.28.4 ~ v5.4.36  The Illuminate Support package.
laravel/envoy                 v2.3.1  ~ v1.6.5   Elegant SSH tasks for PHP.
laravel/installer             v4.1.0  ~ v2.3.0   Laravel application installer.
laravel/valet                 v2.11.0 ! v2.13.16 A more enjoyable local development experience for Mac.
mnapoli/silly                 1.7.2   ~ 1.5.1    Silly CLI micro-framework based on Symfony Console
nategood/httpful              0.3.2   ~ 0.2.20   A Readable, Chainable, REST friendly, PHP HTTP Client
nesbot/carbon                 2.41.5  ~ 1.39.1   An API extension for DateTime that supports 281 different languages.
php-di/invoker                2.2.0   ~ 2.0.0    Generic and extensible callable invoker
psr/http-client               1.0.1   Common interface for HTTP clients
symfony/console               v5.1.7  ~ v3.4.47  Symfony Console Component
symfony/polyfill-php80        v1.19.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process               v5.1.7  ~ v3.4.47  Symfony Process Component
symfony/service-contracts     v2.2.0  Generic abstractions related to writing services
symfony/string                v5.1.7  Symfony String component
symfony/translation           v5.1.7  ~ v3.4.47  Symfony Translation Component
symfony/translation-contracts v2.3.0  Generic abstractions related to translation
symfony/var-dumper            v5.1.7  ~ v3.4.47  Symfony mechanism for exploring and dumping PHP variables
tightenco/collect             v7.26.1 ~ v5.4.33  Collect - Illuminate Collections as a separate package.
voku/portable-ascii           1.5.3   Portable ASCII library - performance optimized (ascii) string functions for php.



ls -al /etc/sudoers.d/

total 0
drwxr-xr-x   2 root  wheel    64 Aug 25  2019 .
drwxr-xr-x  85 root  wheel  2720 Dec 12 03:30 ..



brew config

HOMEBREW_VERSION: 2.7.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 993bf95877143afe1cede022083499e0b4fe336c
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: bcd3c911ecdd41b8788e68481db3a9e5b7d24c45
Core tap last commit: 19 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit haswell
Clang: 11.0 build 1103
Git: 2.23.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 14.0.1
macOS: 10.15.7-x86_64
CLT: 1103.0.32.59
Xcode: N/A



brew services list

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



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

dnsmasq 2.81 2.82
mysql 8.0.22_1
[email protected] 5.7.32
nginx 1.19.6 1.19.0
[email protected] 1.1.1i
php 8.0.0_1 7.4.6_1
[email protected] 7.3.18_1 7.3.25_1
[email protected] 7.4.13_1



brew outdated





php -v

PHP 8.0.0 (cli) (built: Nov 30 2020 13:47:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies



which -a php

/usr/local/bin/php
/usr/bin/php



php --ini

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



nginx -v

nginx version: nginx/1.19.6



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.74.0
Age => 7
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
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
HTTPS_PROXY => Yes
MULTI_SSL => Yes
BROTLI => Yes
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin19.6.0
SSL Version => (SecureTransport) OpenSSL/1.1.1i
ZLib Version => 1.2.11
libSSH Version => libssh2/1.9.0

Directive => Local Value => Master Value
curl.cainfo => no value => no value



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

ngrok version 2.3.35



ls -al ~/.ngrok2

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



brew info nginx

nginx: stable 1.19.6 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.19.0 (22 files, 2.1MB)
  Built from source
/usr/local/Cellar/nginx/1.19.6 (25 files, 2.2MB) *
  Poured from bottle on 2020-12-25 at 00:54:19
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nginx.rb
License: BSD-2-Clause
==> 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: 48,643 (30 days), 137,659 (90 days), 453,678 (365 days)
install-on-request: 48,352 (30 days), 135,875 (90 days), 442,828 (365 days)
build-error: 0 (30 days)



brew info php

php: stable 8.0.0 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/php/7.4.6_1 (517 files, 76.1MB)
  Built from source
/usr/local/Cellar/php/8.0.0_1 (499 files, 77.8MB) *
  Poured from bottle on 2020-12-25 at 01:00:26
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/php.rb
License: PHP-3.01
==> Dependencies
Build: httpd, pkg-config
Required: apr, apr-util, argon2, aspell, autoconf, curl, freetds, gd, gettext, glib, gmp, icu4c, krb5, libffi, libpq, libsodium, libzip, oniguruma, openldap, [email protected], pcre2, sqlite, tidy-html5, unixodbc
==> Options
--HEAD
    Install HEAD version
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.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/8.0/

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: 62,172 (30 days), 169,821 (90 days), 599,243 (365 days)
install-on-request: 60,721 (30 days), 166,427 (90 days), 574,504 (365 days)
build-error: 0 (30 days)



brew info openssl

[email protected]: stable 1.1.1i (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/[email protected]/1.1.1i (8,067 files, 18.5MB)
  Poured from bottle on 2020-12-19 at 01:27:31
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]
License: OpenSSL
==> 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: 852,404 (30 days), 2,345,607 (90 days), 7,796,560 (365 days)
install-on-request: 137,872 (30 days), 370,336 (90 days), 1,115,650 (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/sbin/php-fpm



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

PHP 8.0.0 (fpm-fcgi) (built: Nov 30 2020 13:47:39)
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0, Copyright (c), by Zend Technologies



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

[26-Dec-2020 19:46:28] NOTICE: configuration file /usr/local/etc/php/8.0/php-fpm.conf test is successful



ls -al ~/Library/LaunchAgents | grep homebrew

-rw-r--r--   1 macbook  staff   543 Jun  2  2020 homebrew.mxcl.mysql.plist
-rw-r--r--   1 macbook  staff   823 Nov 18 23:54 homebrew.mxcl.redis.plist



ls -al /Library/LaunchAgents | grep homebrew





ls -al /Library/LaunchDaemons | grep homebrew

-rw-r--r--   1 root  admin   657 Dec 21 11:06 homebrew.mxcl.dnsmasq.plist

Is there a specific reason why you had locked it to PHP 5.6.36?
If not, then I suggest deleting the whole "config" array from your ~/.composer/composer.json file

cat ~/.composer/composer.json

{
    "require": {
        "laravel/valet": "^2.10",
        "laravel/envoy": "^2.3",
        "laravel/installer": "^4.1"
-    },
-    "config": {
-        "platform": {
-            "php": "5.6.36"
-        }
    }
}

@drbyte .

I don't know how it happens!

Let me remove the config and try again!

@drbyte

Thank you.. It was working! and I were successful to use PHP 8.0

Unfortunately I got another error..

Just a few moments ago, I needed to fix an error on an older project which required PHP 5.6. That's why I run the following command
valet use [email protected]

The command was working and I have fixed the error. So, I feel go to PHP 7.3/php8. But I am unable to go back the newest PHP version for the following errors.

image

You can probably fix that by running: brew unlink [email protected] and then valet use php.
Since you also already have PHP8 installed, if the above isn't enough, then also run: brew link php or brew link [email protected].

@drbyte

wow! It is now working. You saved my life

Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VinceG picture VinceG  路  3Comments

dustinleblanc picture dustinleblanc  路  4Comments

tomirons picture tomirons  路  4Comments

marianvlad picture marianvlad  路  5Comments

TimOgilvy picture TimOgilvy  路  3Comments