laravel / valet

A more enjoyable local development experience for Mac.
https://laravel.com/docs/valet
MIT License
2.52k stars 697 forks source link

Valet install stuck at Installing nginx directory... #1106

Closed sweebee closed 2 years ago

sweebee commented 2 years ago

Clear description of your problem

I was running valet with PHP 8.0 but I needed to switch to 7.4 to I ran valet use php@7.4. After that valet was completely broken. I tried to run valet install again but its stuck at Installing nginx directory.... I left it for at least 2 hours and nothing changes.

Tried the following:

valet uninstall
rm -f ~/.config/valet/valet.sock
composer global remove laravel/valet
brew uninstall nginx
brew install nginx
brew link --force --overwrite php@7.4
composer global require laravel/valet
valet install

Expected behavior

Succesfully install valet and it should work

Current behavior

Stuck at Installing nginx directory...

Steps to Reproduce

dont know

Diagnosis

removed the domains

sw_vers
ProductName:   macOS
ProductVersion: 12.1
BuildVersion:   21C5031d
valet --version
Laravel Valet 2.16.1
cat ~/.config/valet/config.json
{
    "tld": "test",
    "paths": [
        "/Users/Wiebe/.config/valet/Sites"
    ],
    "loopback": "127.0.0.1"
}
cat ~/.composer/composer.json
{
    "require": {
        "laravel/valet": "^2.16",
        "laravel/vapor-cli": "^1.24"
    }
}
composer global diagnose
Changed current directory to /Users/Wiebe/.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.1.12
PHP version: 7.4.25
PHP binary path: /usr/local/Cellar/php@7.4/7.4.25.reinstall/bin/php
OpenSSL version: OpenSSL 1.1.1l  24 Aug 2021
cURL version: 7.80.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/1.1.1l
zip: extension present, unzip present, 7-Zip not available
composer global outdated
Changed current directory to /Users/Wiebe/.composer
Legend:
! patch or minor release available - update recommended
~ major release available - update possible
league/flysystem           1.1.5  ~ 2.3.1 Filesystem abstraction: Many filesystems, one API.
league/flysystem-aws-s3-v3 1.0.29 ~ 2.1.0 Flysystem adapter for the AWS S3 SDK v3.x
psr/container              1.1.2  ~ 2.0.2 Common Container Interface (PHP FIG PSR-11)
ls -al /etc/sudoers.d/
total 16
drwxr-xr-x    4 root  wheel   128 15 nov 16:29 .
drwxr-xr-x  115 root  wheel  3680 15 nov 16:29 ..
-rw-r--r--    1 root  wheel    80  2 nov 11:05 brew
-rw-r--r--    1 root  wheel    83  2 nov 11:05 valet
brew config
HOMEBREW_VERSION: 3.3.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: 819eea5669807c1cf29e0d29985fc765ad7a9597
Last commit: 18 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: b3ff4ab90a3f0a234f3f856609e5deccad106b11
Core tap last commit: 64 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 13.0.0 build 1300
Git: 2.30.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.77.0 => /usr/bin/curl
macOS: 12.1-x86_64
CLT: 12.5.0.22.9
Xcode: 13.1
brew services list
Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the elastic/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/elastic/homebrew-tap/Formula/elasticsearch-full.rb:9

256
19968
Name               Status  User  File
dnsmasq            stopped       
elasticsearch-full error   Wiebe 
httpd              stopped       
mailhog            started Wiebe ~/Library/LaunchAgents/homebrew.mxcl.mailhog.plist
nginx              stopped       
php                stopped       
php@7.3            stopped       
php@7.4            error   Wiebe 
redis              stopped
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
dnsmasq 2.86
mailhog 1.0.1
nginx 1.21.4 1.21.1
openssl@1.1 1.1.1l_1
php 8.0.12 8.0.8_1
php@7.3 7.3.29_1 7.3.32
php@7.4 7.4.25.reinstall 7.4.16.reinstall 7.4.19_1.reinstall 7.4.21_1
brew outdated
Warning: Calling bottle :unneeded is deprecated! There is no replacement.
Please report this issue to the elastic/tap tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/elastic/homebrew-tap/Formula/elasticsearch-full.rb:9

arp-scan
boost-python
cmake
elastic/tap/elasticsearch-full
fastlane
ffmpeg
gradle
imagemagick
jansson
jq
kubectl
libidn
libogg
libusb
libvorbis
libvpx
lua
makedepend
ncdu
node
nvm
open-zwave
openjdk@11
opus
parallel
qrencode
redis
sdl2
sonar-scanner
tcl-tk
telnet
wget
x264
x265
xvid
osxfuse
brew tap
elastic/tap
homebrew/cask
homebrew/cask-versions
homebrew/core
homebrew/php
homebrew/services
netlify/netlifyctl
nicoverbruggen/cask
shivammathur/php
php -v
PHP 7.4.25 (cli) (built: Nov  5 2021 13:11:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.25, Copyright (c), by Zend Technologies
which -a php
/usr/local/bin/php
php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File:         /usr/local/etc/php/7.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed:      /usr/local/etc/php/7.4/conf.d/error_log.ini,
/usr/local/etc/php/7.4/conf.d/ext-opcache.ini,
/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini
nginx -v
nginx version: nginx/1.21.4
curl --version
curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
Release-Date: 2021-05-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets
php --ri curl
curl

cURL support => enabled
cURL Information => 7.80.0
Age => 9
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, gophers, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin21.1.0
SSL Version => (SecureTransport) OpenSSL/1.1.1l
ZLib Version => 1.2.11
libSSH Version => libssh2/1.10.0

Directive => Local Value => Master Value
curl.cainfo => no value => no value
~/.composer/vendor/laravel/valet/bin/ngrok version
ngrok version 2.3.40
ls -al ~/.ngrok2
total 8
drwxr-xr-x    3 Wiebe  staff    96 15 nov 10:14 .
drwxr-xr-x@ 145 Wiebe  staff  4640 16 nov 09:10 ..
-rw-r--r--    1 Wiebe  staff    54 15 nov 10:14 ngrok.yml
brew info nginx
nginx: stable 1.21.4 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/usr/local/Cellar/nginx/1.21.1 (22 files, 2.2MB)
  Built from source
/usr/local/Cellar/nginx/1.21.4 (28 files, 2.2MB) *
  Poured from bottle on 2021-11-16 at 09:03:12
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 restart nginx after an upgrade:
  brew services restart nginx
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/nginx/bin/nginx -g daemon off;
==> Analytics
install: 47,218 (30 days), 131,659 (90 days), 514,055 (365 days)
install-on-request: 47,121 (30 days), 131,329 (90 days), 512,564 (365 days)
build-error: 24 (30 days)
brew info php
php: stable 8.0.12 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/usr/local/Cellar/php/8.0.8_1 (497 files, 77.8MB)
  Built from source
/usr/local/Cellar/php/8.0.12 (500 files, 77.9MB)
  Poured from bottle on 2021-11-02 at 11:08:08
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, 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 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 restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/php/sbin/php-fpm --nodaemonize
==> Analytics
install: 85,983 (30 days), 190,568 (90 days), 657,104 (365 days)
install-on-request: 72,185 (30 days), 175,219 (90 days), 632,972 (365 days)
build-error: 75 (30 days)
brew info openssl
openssl@3: stable 3.0.0 (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@3.rb
License: Apache-2.0
==> Dependencies
Required: ca-certificates
==> 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@3/certs

and run
  /usr/local/opt/openssl@3/bin/c_rehash

openssl@3 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

==> Analytics
install: 87,269 (30 days), 161,856 (90 days), 161,857 (365 days)
install-on-request: 72,129 (30 days), 132,053 (90 days), 132,054 (365 days)
build-error: 4,421 (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: [emerg] open() "/usr/local/etc/nginx/mime.types" failed (2: No such file or directory) in /usr/local/etc/nginx/nginx.conf:9
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
which -a php-fpm

/usr/local/opt/php/sbin/php-fpm -v
PHP 8.0.12 (fpm-fcgi) (built: Oct 21 2021 14:38:38)
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies
sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/7.4/php-fpm.conf --test
[16-Nov-2021 09:10:42] NOTICE: configuration file /usr/local/etc/php/7.4/php-fpm.conf test is successful
ls -al ~/Library/LaunchAgents | grep homebrew
-rw-r--r--    1 Wiebe  staff   781 11 nov 11:53 homebrew.mxcl.elasticsearch-full.plist
-rw-r--r--    1 Wiebe  staff   771  4 jun  2018 homebrew.mxcl.elasticsearch.plist
-rw-r--r--    1 Wiebe  staff   566  2 nov 10:58 homebrew.mxcl.mailhog.plist
-rw-r--r--    1 Wiebe  staff   636 28 dec  2018 homebrew.mxcl.php@5.6.plist
-rw-r--r--    1 Wiebe  staff   585 16 nov 09:01 homebrew.mxcl.php@7.4.plist
ls -al /Library/LaunchAgents | grep homebrew

ls -al /Library/LaunchDaemons | grep homebrew
-rw-r--r--   1 root  admin    593 15 nov 16:56 homebrew.mxcl.dnsmasq.plist
-rw-r--r--   1 root  wheel    771  1 apr  2021 homebrew.mxcl.elasticsearch.plist
-rw-r--r--   1 root  admin    536  3 nov 14:35 homebrew.mxcl.mysql@5.7.plist
-rw-r--r--   1 root  admin    577 15 nov 16:57 homebrew.mxcl.php.plist
-rw-r--r--   1 root  wheel    740  3 apr  2018 homebrew.mxcl.php71.plist
-rw-r--r--   1 root  admin    585 15 nov 16:11 homebrew.mxcl.php@7.4.plist
-rw-r--r--   1 root  wheel    823  1 apr  2021 homebrew.mxcl.redis.plist
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."

ls -aln /etc/resolv.conf
lrwxr-xr-x  1 0  0  22  4 nov 12:55 /etc/resolv.conf -> ../var/run/resolv.conf
cat /etc/resolv.conf
#
# macOS Notice
#
# This file is not consulted for DNS hostname resolution, address
# resolution, or the DNS query routing mechanism used by most
# processes on this system.
#
# To view the DNS configuration used by this system, use:
#   scutil --dns
#
# SEE ALSO
#   dns-sd(1), scutil(8)
#
# This file is automatically generated.
#
nameserver 1.1.1.1
nameserver 185.39.47.11
ifconfig lo0
lo0: flags=8049 mtu 16384
    options=1203
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet 127.94.0.1 netmask 0xff000000 
    nd6 options=201
sh -c 'echo "------\n/usr/local/etc/nginx/valet/valet.conf\n---\n"; cat /usr/local/etc/nginx/valet/valet.conf | grep -n "# valet loopback"; echo "\n------\n"'
------
/usr/local/etc/nginx/valet/valet.conf
---

3:    #listen VALET_LOOPBACK:80; # valet loopback

------
sh -c 'for file in ~/.config/valet/dnsmasq.d/*; do echo "------\n~/.config/valet/dnsmasq.d/$(basename $file)\n---\n"; cat $file; echo "\n------\n"; done'
------
~/.config/valet/dnsmasq.d/tld-test.conf
---

address=/.test/127.0.0.1
listen-address=127.0.0.1

------
LTKort commented 2 years ago

Probably an error in your nginx config:

nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed

What's the content of the conf?

webmastervinay commented 2 years ago
rm -rf ~/.config/valet
valet install

This should solve your problem.

lonnylot commented 2 years ago

@sweebee I'm having the same issue. Did you find a fix for this?

ihorvorotnov commented 2 years ago

I had the same issue recently, as I understood it fails on certificates step when it should ask for your password to update the keychain, but it doesn't. I don't remember the exact steps, so something may be missing, but here's (more or less) how I fixed it:

And this time iTerm actually asked for the password/fingerprint, although the popup is always without focus (under iTerm window). I'm assuming it can be a macOS bug. Anyway, knowing what causes Nginx installation step to hang and how to fix it should help.