valet: `valet install` results in PHP service restarting with error
➜ ~ brew services list
Name Status User Plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mysql@5.7 started ryan /Users/ryan/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php error root /Library/LaunchDaemons/homebrew.mxcl.php.plist
redis started ryan /Users/ryan/Library/LaunchAgents/homebrew.mxcl.redis.plist
Not sure why but every time I run valet install
my php service is in an error status. Manually running brew services restart php
brings it up without error with a status of started
.
Am I doing something wrong or is there a log file I can check or something?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (6 by maintainers)
I fixed my issue last night by doing this:
brew uninstall php
brew uninstall php@5.6
brew uninstall php@7.1
brew uninstall php@7.2
brew cleanup
brew services cleanup
sudo brew services cleanup
brew doctor
brew update
brew install php
valet install
My
/usr/local/var/log/php-fpm.log
doesn’t get spammed with that junk anymore.I haven’t tried reinstalling the older versions of php though as I’m afraid the issue might come back. I’m currently running php 7.3.1
edit: I suspect the issue has something to do with having multiple versions of PHP installed with homebrew. Though simply having the services stopped didn’t seem to matter, they needed to actually be uninstalled.
brew services restart php
Odd, I did
I noticed that after stopping it, it now said that php was started, when before it said there was an error. When I tried to stop it again it says:
It seems to be running fine under root, but it seems that there was also a user service competing against the root service :\ so odd…
Now my log file is not growing constantly 😃 (hopefully this holds up for a reboot or valet restart.
Now I no longer see the php mxcl plist file in the
~/Library/LaunchAgents
either.brew services restart php
After that vulnerability in PHP-FPM a few days ago I had updated my php on a Catalina install and my fpm-php log blew up overnite with the exact errors above and crashed the computer (over 48GB log file, ran out of space). @ryanmortier - followed his steps, and now its working just fine!
I was getting the 502 errors in the browser and
FPM initialization failed
andAn another FPM instance seems to already listen on...
errors in my php-fpm.log file. It turned out that large cookies/headers were causing the issue. I created a .conf file in my~/.config/valet/Nginx/
and added the following lines and it fixed it for me.