Closed shiroamada closed 3 years ago
valet use php@version
is working in terminal, which means when I run php -v
, it show the correct version, but when I run in browser, it just show 7.4.9.
Today I want to install PHP Redis
after I run pecl install redis
, then I run
valet restart
Restarting dnsmasq...
Restarting php@7.3...
Restarting nginx...
Valet services have been restarted.
When I access to phpinfo(); It switch from PHP Version 7.3.21 to PHP Version 7.4.9
even I run again
» valet use php@7.3 [2020/09/2 |09:51:49]
Stopping php...
Unlinking current version: php@7.3
Linking new version: php@7.3
Updating PHP configuration...
Restarting php@7.3...
Restarting nginx...
Valet is now using php@7.3.
Note that you might need to run composer global update if your PHP version change affects the dependencies of global packages required by Composer.
But now it is keep using 7.4 version.
Valet Diagnose
ProductName: Mac OS X ProductVersion: 10.15.5 BuildVersion: 19F101
Laravel Valet 2.11.0
{ "domain": "test", "paths": [ "/Users/shiroamada/Sites" ], "tld": "test" }
{ "require": { "laravel/installer": "^3.0", "laravel/valet": "^2.0", "phpunit/phpunit": "^8.0" }, "require-dev": { "brainmaestro/composer-git-hooks": "^2.8" } }
Changed current directory to /Users/shiroamada/.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 oauth access: 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: You are not running the latest stable version, run `composer self-update` to update (1.10.5 => 1.10.10) Composer version: 1.10.5 PHP version: 7.3.21 PHP binary path: /usr/local/Cellar/php@7.3/7.3.21/bin/php OpenSSL version: OpenSSL 1.1.1g 21 Apr 2020
Changed current directory to /Users/shiroamada/.composer phar-io/manifest 1.0.3 ~ 2.0.1 Component for reading phar.io manifest information from a PHP Archive (PHAR) phar-io/version 2.0.1 ~ 3.0.2 Library for handling version information and constraints phpunit/php-code-coverage 7.0.10 ~ 9.1.6 Library that provides collection, processing, and rendering functionality for PHP code coverage information. phpunit/php-file-iterator 2.0.2 ~ 3.0.4 FilterIterator implementation that filters files based on a list of suffixes. phpunit/php-text-template 1.2.1 ~ 2.0.2 Simple template engine. phpunit/php-timer 2.1.2 ~ 5.0.1 Utility class for timing phpunit/php-token-stream 3.1.1 ~ 4.0.4 Wrapper around PHP's tokenizer extension. Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. phpunit/phpunit 8.5.8 ~ 9.3.8 The PHP Unit Testing framework. sebastian/code-unit-reverse-lookup 1.0.1 ~ 2.0.2 Looks up which function or method a line of code belongs to sebastian/comparator 3.0.2 ~ 4.0.3 Provides the functionality to compare PHP values for equality sebastian/diff 3.0.2 ~ 4.0.2 Diff implementation sebastian/environment 4.2.3 ~ 5.1.2 Provides functionality to handle HHVM/PHP environments sebastian/exporter 3.1.2 ~ 4.0.2 Provides the functionality to export PHP variables for visualization sebastian/global-state 3.0.0 ~ 5.0.0 Snapshotting of global state sebastian/object-enumerator 3.0.3 ~ 4.0.2 Traverses array structures and object graphs to enumerate all referenced objects sebastian/object-reflector 1.1.1 ~ 2.0.2 Allows reflection of object attributes, including inherited and non-public ones sebastian/recursion-context 3.0.0 ~ 4.0.2 Provides functionality to recursively process PHP variables sebastian/resource-operations 2.0.1 ~ 3.0.2 Provides a list of PHP built-in functions that operate on resources sebastian/type 1.1.3 ~ 2.2.1 Collection of value objects that represent the types of the PHP type system sebastian/version 2.0.1 ~ 3.0.1 Library that helps with managing the version number of Git-hosted PHP projects
total 16 drwxr-xr-x 4 root wheel 128 Jun 14 10:31 . drwxr-xr-x 115 root wheel 3680 Sep 1 23:26 .. -rw-r--r-- 1 root wheel 80 Sep 27 2019 brew -rw-r--r-- 1 root wheel 83 Sep 27 2019 valet
HOMEBREW_VERSION: 2.4.16 ORIGIN: https://github.com/Homebrew/brew HEAD: 2a4c9f610e69b9fed1eec61ac2c53e4b11a32e4c Last commit: 34 hours ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 3629fc562f8e199a53c204c3d9bcb616a7ee9ee5 Core tap last commit: 45 minutes ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 12 CPU: dodeca-core 64-bit kabylake 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 => /Applications/Xcode.app/Contents/Developer/usr/bin/git Curl: 7.64.1 => /usr/bin/curl Java: 1.8.0_144 macOS: 10.15.5-x86_64 CLT: 11.5.0.0.1.1588476445 Xcode: 11.6
Name Status User Plist dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist mariadb started shiroamada /Users/shiroamada/Library/LaunchAgents/homebrew.mxcl.mariadb.plist nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist php started shiroamada /Users/shiroamada/Library/LaunchAgents/homebrew.mxcl.php.plist php@7.3 error root /Library/LaunchDaemons/homebrew.mxcl.php@7.3.plist redis started shiroamada /Users/shiroamada/Library/LaunchAgents/homebrew.mxcl.redis.plist
curl-openssl 7.72.0 dnsmasq 2.82 mariadb 10.5.5 nginx 1.19.2 openssl@1.1 1.1.1g php 7.4.9 php@7.3 7.3.21
groonga redis
PHP 7.3.21 (cli) (built: Aug 7 2020 18:56:36) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.21, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.21, Copyright (c) 1999-2018, by Zend Technologies
/usr/local/bin/php /usr/bin/php
Configuration File (php.ini) Path: /usr/local/etc/php/7.3 Loaded Configuration File: /usr/local/etc/php/7.3/php.ini Scan for additional .ini files in: /usr/local/etc/php/7.3/conf.d Additional .ini files parsed: /usr/local/etc/php/7.3/conf.d/ext-opcache.ini, /usr/local/etc/php/7.3/conf.d/php-memory-limits.ini
nginx version: nginx/1.19.2
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
curl cURL support => enabled cURL Information => 7.72.0 Age => 7 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 HTTPS_PROXY => Yes MULTI_SSL => No BROTLI => Yes 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.5.0 SSL Version => OpenSSL/1.1.1g ZLib Version => 1.2.11 libSSH Version => libssh2/1.9.0 Directive => Local Value => Master Value curl.cainfo => no value => no value
ngrok version 2.3.35
total 8 drwx------ 3 shiroamada staff 96 Sep 8 2018 . drwxr-xr-x+ 85 shiroamada staff 2720 Sep 2 09:58 .. -rw------- 1 shiroamada staff 55 Sep 8 2018 ngrok.yml
nginx: stable 1.19.2 (bottled), HEAD HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server https://nginx.org/ /usr/local/Cellar/nginx/1.19.2 (25 files, 2.1MB) * Poured from bottle on 2020-09-01 at 17:25:53 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nginx.rb License: BSD-2-Clause ==> Dependencies Required: openssl@1.1, 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,709 (30 days), 102,833 (90 days), 406,966 (365 days) install-on-request: 35,925 (30 days), 100,628 (90 days), 394,466 (365 days) build-error: 0 (30 days)
php: stable 7.4.9 (bottled), HEAD General-purpose scripting language https://www.php.net/ /usr/local/Cellar/php/7.4.9 (497 files, 72.2MB) Poured from bottle on 2020-09-01 at 18:01:50 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-openssl, freetds, gd, gettext, glib, gmp, icu4c, krb5, libffi, libpq, libsodium, libzip, oniguruma, openldap, openssl@1.1, 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 php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.soSetHandler 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: 53,902 (30 days), 152,754 (90 days), 556,954 (365 days) install-on-request: 52,575 (30 days), 148,308 (90 days), 524,400 (365 days) build-error: 0 (30 days)
openssl@1.1: stable 1.1.1g (bottled) [keg-only] Cryptography and SSL/TLS Toolkit https://openssl.org/ /usr/local/Cellar/openssl@1.1/1.1.1g (8,059 files, 18MB) Poured from bottle on 2020-06-21 at 20:21:28 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb 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/openssl@1.1/certs and run /usr/local/opt/openssl@1.1/bin/c_rehash openssl@1.1 is keg-only, which means it was not symlinked into /usr/local, because macOS provides LibreSSL. If you need to have openssl@1.1 first in your PATH run: echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc For compilers to find openssl@1.1 you may need to set: export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" For pkg-config to find openssl@1.1 you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" ==> Analytics install: 601,929 (30 days), 1,782,149 (90 days), 7,248,662 (365 days) install-on-request: 65,570 (30 days), 211,930 (90 days), 906,471 (365 days) build-error: 0 (30 days)
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"
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
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
/usr/local/sbin/php-fpm /usr/sbin/php-fpm
PHP 7.4.9 (fpm-fcgi) (built: Aug 7 2020 19:23:16) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.9, Copyright (c), by Zend Technologies
[02-Sep-2020 09:59:22] NOTICE: configuration file /usr/local/etc/php/7.3/php-fpm.conf test is successful
-rw-r--r-- 1 shiroamada staff 541 Feb 24 2020 homebrew.mxcl.mariadb.plist -rw-r--r-- 1 shiroamada staff 571 Feb 21 2020 homebrew.mxcl.nginx.plist -rw-r--r-- 1 shiroamada staff 628 Aug 7 16:03 homebrew.mxcl.php.plist -rw-r--r-- 1 shiroamada staff 636 Dec 22 2018 homebrew.mxcl.php@7.2.plist -rw-r--r-- 1 shiroamada staff 636 Mar 11 11:44 homebrew.mxcl.php@7.3.plist -rw-r--r-- 1 shiroamada staff 823 Oct 23 2019 homebrew.mxcl.redis.plist
-rw-r--r-- 1 root admin 657 Sep 2 09:51 homebrew.mxcl.dnsmasq.plist -rw-r--r-- 1 root admin 571 Sep 2 09:57 homebrew.mxcl.nginx.plist -rw-r--r-- 1 root admin 636 Oct 2 2019 homebrew.mxcl.php@7.2.plist -rw-r--r-- 1 root admin 636 Sep 2 09:57 homebrew.mxcl.php@7.3.plist
Observations:
brew services list
shows error
in php status~/Library/LaunchAgents
and in /Library/LaunchDaemons
, meaning you're running some PHP versions as root and some as non-root. One reason this happens is when you start processes manually instead of letting Valet do it.Solution:
Uninstall all PHP versions managed by homebrew.
Then delete all leftover PHP plists from both ~/Library/LaunchAgents
and /Library/LaunchDaemons
Then run valet use
for whichever PHP version you intend.
Since you have orphaned processes running in the background (eg: php versions that the plist files tried to start, even though they point to invalid paths), you may require another reboot to properly release them.
MacOS 10.15.5 Laravel Valet 2.11.0
Clear description of your problem
valet not taking valet use php@version until restart the OS
Expected behavior
I expect after I run `valet use php@version it will take immediate update
Current behavior
It does not take the version update, it only work after I restart
Steps to Reproduce
valet use php@7.3
valuet use php@7.4
Output of these steps
My current output running with phpinfo is 7.4.8 I did run uninstall --force, and reinstall it still does not take the 7.3 version
Then I run the
valet install
As I check the latest version install is 7.4.9, However, when I run the phpinfo() still running with 7.4.8, the nginx is like keep loading 7.4.8 php version, it will not take any version upgrade.
I ever remove home brew php@7.4, and I run
valet restart nginx
, it still work.Possible solution
Restart MacOS, but it is possible no need restart my OS
Diagnosis
sw_vers
valet --version
cat ~/.config/valet/config.json
cat ~/.composer/composer.json
composer global diagnose
composer global outdated
ls -al /etc/sudoers.d/
brew config
brew services list
brew list --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
brew outdated
php -v
which -a php
php --ini
nginx -v
curl --version
php --ri curl
~/.composer/vendor/laravel/valet/bin/ngrok version
ls -al ~/.ngrok2
brew info nginx
brew info php
brew info openssl
openssl version -a
openssl ciphers
sudo nginx -t
which -a php-fpm
/usr/local/opt/php/sbin/php-fpm -v
sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/7.3/php-fpm.conf --test
ls -al ~/Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchDaemons | grep homebrew