Hello dear,
OS: catalina 10.15.1
php: 7.4
Yesterday I upgrade my php version to 7.4 after upgrading to php7.4 valet not working properly.
when I try to visit my website it's took longer to loading my site and most of the time says server timeout but when I downgrade my php version to 7.3 it's working fine and load web server within 2second. What's wrong with php7.4?
thanks
Same case for me
in terminal - valet use [email protected]
How exactly did you "upgrade php version to 7.4"?
If you only ran brew upgrade but didn't also run valet install then it won't have configured your PHP 7.4 .ini files for Valet.
Samething for me,
~ valet use [email protected]
Stopping php...
In PhpFpm.php line 148:
Valet doesn't support PHP version: [email protected] (try something like 'php7.2' instead)
fixed after update:
run:
valet on-latest-version
composer global update
valet install
valet use [email protected]
How exactly did you "upgrade php version to 7.4"?
If you only ran
brew upgradebut didn't also runvalet installthen it won't have configured your PHP 7.4.inifiles for Valet.
First update my php via home-brew then uninstall my valet and then install but did't work
Alright. I recommend:
#upgrade composer to latest version:
composer self-update
brew update && brew upgrade && brew cleanup
composer global update
valet install
php -v
If it doesn't say you're using PHP 7.4 then also run:
valet use [email protected]
Alright. I recommend:
brew update && brew upgrade && brew cleanup composer global update valet install php -vIf it doesn't say you're using PHP 7.4 then also run:
valet use [email protected]
not working for me 😫
@Faisal50x Please share any diagnostic information you have. What is the result of php -v? valet on-latest-version? which php? brew services list? Did you get any errors? Basically, give us as much information as you can. Thanks!
Also, you can try unlinking old versions of PHP:
https://github.com/laravel/valet/issues/237#issuecomment-359350235
@Faisal50x Please share any diagnostic information you have. What is the result of
php -v?valet on-latest-version?which php?brew services list? Did you get any errors? Basically, give us as much information as you can. Thanks!Also, you can try unlinking old versions of PHP:
#237 (comment)
➜ ~ php -v
PHP 7.4.0 (cli) (built: Nov 29 2019 16:18:44) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
➜ ~which php
/usr/local/bin/php
➜ ~ brew list | grep php
php
➜ ~valet on-latest-version
yes
@Faisal50x
I think this is an issue with customizations you’ve made to your php config.
Valet is just doing its job of serving up sites you request.
You said it’s slow or server timeout only in a certain php version, but other version is fine. So valet itself is working.
Are you serving Laravel apps? Or something else? Wordpress often has slowness problems because of curl issues, but Laravel runs fine. In those cases sometimes the fix is in a curl setting for that php version.
It’s definitely still not clear here what apps on your machine aren’t working, when for example all the Laravel apps on mine are.
Also, what's the output of the following?
sw_vers
cat ~/.composer/composer.json
valet --version
cat ~/.config/valet/config.json
nginx -v
curl --version
php --ri curl
brew config
brew doctor
brew info nginx
brew info php
sudo nginx -t
ls -al /usr/local/etc/php
It would be wise to take some time to compare all the files (and their contents) in your /usr/local/etc/php/7.4 folder against your /usr/local/etc/php/7.3 folder, including all subfolders.
Today I figured out my actual problem it's not valet issue. This issue arrive from mysql caching_sha2 auth plugin. when I update my brew it's upgrade my mysql to newer version of mysql 8. MySQL 8 default auth plugin is caching_sha2_password auth but php mysql connector can't login via caching_sha2_password when php mysql connector login to mysql server via mysql_native_password plugin it's can't login and wait more and more times that's why Nginx server says server timeout. Today I connect my remote mysql server and it's working fine then I try to connect my local mysql server it's fail and I found actual problem .
thank's all of you guys for giving your valuable time to figuring out of my problem.
@Faisal50x thanks for posting back to clarify the actual cause of the problem in your environment.
@Faisal50x How did you manage to solve the caching_sha2_password issue? I still cannot use [email protected] because nginx gives 504 gateway time-out error. I'm stuck with [email protected]
Apparently the most up-to-date versions of PHP 7.4 shouldn't have the caching_sha2_password issue, but I saw this tweet that may be helpful:
https://twitter.com/JackEllis/status/1215143109127880704
Holy crap. Just ran into that caching_sha2_password nonsense on my local machine with mySQL 8.0.18 and PHP 7.4. After reinstalling everything twice, turns out the solution is super simple:
/usr/local/opt/mysql/my.cnf
[mysqld]
default_authentication_plugin=mysql_native_password
@mattstauffer You are such a great man, thank you so much. After a few minutes of investigation, the trick that you've sent just worked fine. Thank you again 👍
Apparently the most up-to-date versions of PHP 7.4 shouldn't have the caching_sha2_password issue, but I saw this tweet that may be helpful:
https://twitter.com/JackEllis/status/1215143109127880704
Holy crap. Just ran into that caching_sha2_password nonsense on my local machine with mySQL 8.0.18 and PHP 7.4. After reinstalling everything twice, turns out the solution is super simple:
/usr/local/opt/mysql/my.cnf
[mysqld]
default_authentication_plugin=mysql_native_password
Currently using: macOS Catalina 10.15.2
PHP: 7.4.1
MySQL: Ver 8.0.19
I don't find the my.cnf file inside: /usr/local/opt/mysql
I tried manually creating the file and restarting the mysql service, it did not work?
Can anyone guide me? @mattstauffer
For me I had to remove the valet sock and restart, I saw this somewhere but can't find the source to credit the person.
rm ~/.config/valet/valet.sock
valet restart
Alright. I recommend:
brew update && brew upgrade && brew cleanup composer global update valet install php -vIf it doesn't say you're using PHP 7.4 then also run:
valet use [email protected]
This did the job for me but when I did a phpinfo(); die(); inside the public/index.php it still was telling me the old version, BUT.. after rebooting my MacBook it showed the correct version, so maybe this will help some people in the future.
Alright. I recommend:
brew update && brew upgrade && brew cleanup composer global update valet install php -vIf it doesn't say you're using PHP 7.4 then also run:
valet use [email protected]
Initially this would still give me that 7.4 is not available. What I had to do was update composer to the latest version (2.0.8) and only then when I ran composer global update it did update the packages. On the older version of composer it didn't do anything.
Most helpful comment
fixed after update:
run:
valet on-latest-versioncomposer global updatevalet installvalet use [email protected]