嗨,我试图将php更新到8.0,但代客读取新版本时总是出现问题我试图在没有具体说明的情况下解决它,但这次被卡住了我将缩短我的问题并打印valet diagnose
valet --version
Laravel Valet 2.14.1
brew services list
dnsmasq error root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
httpd stopped
mysql started mohammedalama /usr/local/opt/mysql/homebrew.mxcl.mysql.plist
nginx error root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php error root /Library/LaunchDaemons/homebrew.mxcl.php.plist
redis started mohammedalama /usr/local/opt/redis/homebrew.mxcl.redis.plist
supervisor started mohammedalama /usr/local/opt/supervisor/homebrew.mxcl.supervisor.plist
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@d..*)?s"
dnsmasq 2.84
mysql 8.0.19
nginx 1.19.8
openssl@1.1 1.1.1k
php 8.0.3
php -v
PHP 8.0.3 (cli) (built: Mar 4 2021 20:45:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/8.0
Loaded Configuration File: (none)
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/error_log.ini,
/usr/local/etc/php/8.0/conf.d/php-memory-limits.ini
nginx -v
nginx版本:nginx/1.19.8
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
sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/8.0/php-fpm.conf --test
[04-Apr-2021 11:20:10] ERROR: failed to open configuration file '/usr/local/etc/php/8.0/php-fpm.conf': No such file or directory (2)
[04-Apr-2021 11:20:10] ERROR: failed to load configuration file '/usr/local/etc/php/8.0/php-fpm.conf'
[04-Apr-2021 11:20:10] ERROR: FPM initialization failed
ls -al /Library/LaunchAgents | grep homebrew
output is empty
ls -al /Library/LaunchDaemons | grep homebrew
-rw-r--r-- 1 root admin 657 Apr 4 11:03 homebrew.mxcl.dnsmasq.plist
-rw-r--r-- 1 root admin 571 Apr 4 11:03 homebrew.mxcl.nginx.plist
-rw-r--r-- 1 root admin 628 Apr 4 11:03 homebrew.mxcl.php.plis
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."
output is empty
您使用的是Mac操作系统,对吗?sudo brew services list
显示php error root
,所以看起来php fpm无法启动
我也遇到过类似的问题,但我发现了github问题:https://github.com/laravel/valet/issues/269
起初,我更改了代客泊车的php版本:
$ valet use php@8.0
$ sudo brew services stop php
$ brew services stop php
$ valet install
然后,根据github问题yratof的评论,我复制了/usr/local/etc/php/8.0/php-fpm.d/valet-fpm.conf
到CCD_ 16。然后运行:
$ valet install
$ valet restart
然后通过再次检查php的状态
$ sudo brew services list
如果php的错误被删除,我认为代客泊车将正常工作。