laravel / valet

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

Valet share not works #1455

Closed carlosvaldesweb closed 11 months ago

carlosvaldesweb commented 11 months ago

Description

Hello, i'm trying to run "valet share" but i can't, i'm getting

/opt/homebrew/bin/valet: line 48: /Users/carlos/Library/Application: No such file or directory
Please use 'valet share-tool ngrok' or 'valet share-tool expose'
to set your preferred share tool.

I've tried to reinstall valet, but is the same.

Any help?

Steps To Reproduce

Only i'm in the folder with project and run valet share

Diagnosis

sw_vers
ProductName:       macOS
ProductVersion:     13.1
BuildVersion:       22C65
valet --version
Laravel Valet 4.5.0
cat ~/.config/valet/config.json
{
    "tld": "test",
    "loopback": "127.0.0.1",
    "paths": [
        "/Users/carlos/.config/valet/Sites"
    ],
    "share-tool": "ngrok"
}
cat ~/.composer/composer.json
{
    "require": {
        "squizlabs/php_codesniffer": "^3.7",
        "awssat/tailwindo": "^3.0",
        "laravel/installer": "^4.2",
        "beyondcode/expose": "^2.6",
        "laravel/valet": "^4.5"
    }
}
composer global diagnose
Changed current directory to /Users/carlos/.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 git version 2.42.0
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.6.5
PHP version: 8.2.10
PHP binary path: /Users/carlos/Library/Application Support/Herd/bin/php82
OpenSSL version: OpenSSL 3.1.2 1 Aug 2023
cURL version: 8.2.1 libz 1.3 ssl OpenSSL/3.1.2
zip: extension present, unzip present, 7-Zip not available
composer global outdated
Changed current directory to /Users/carlos/.composer
Legend:
! patch or minor release available - update recommended
~ major release available - update possible

Direct dependencies required in composer.json:
laravel/installer v4.5.1  ~ v5.1.3 Laravel application installer.

Transitive dependencies not required in composer.json:
symfony/console   v5.4.28 ~ v6.3.4 Eases the creation of beautiful and testa...
ls -al /etc/sudoers.d/
total 0
drwxr-xr-x   2 root  wheel    64 Sep  8 16:01 .
drwxr-xr-x  82 root  wheel  2624 Oct 11 15:30 ..
brew config
HOMEBREW_VERSION: 4.1.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: e57a87cfe9c15f192cd4fc6695a2b3b7acf0ddf7
Last commit: 2 days ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 69a45521b27ef7ee8a117e686bbbd2675f9b9cf5
Core tap last commit: 12 minutes ago
Core tap branch: master
Core tap JSON: 11 Oct 21:52 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.3 build 1403
Git: 2.42.0 => /opt/homebrew/bin/git
Curl: 7.85.0 => /usr/bin/curl
macOS: 13.1-arm64
CLT: 12.5.0.22.9
Xcode: 14.3.1
Rosetta 2: false
brew services list
Warning: running through sudo, using user/* instead of gui/* domain!
Hide this warning by setting HOMEBREW_SERVICES_NO_DOMAIN_WARNING.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Name      Status User   File
dnsmasq   none            root   
mailhog   started         carlos ~/Library/LaunchAgents/homebrew.mxcl.mailhog.plist
mysql     started         carlos ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql@5.7 error  256      carlos ~/Library/LaunchAgents/homebrew.mxcl.mysql@5.7.plist
nginx     none            root   
php       started         carlos ~/Library/LaunchAgents/homebrew.mxcl.php.plist
php@8.1   none            root   
redis     started         carlos ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
dnsmasq 2.89
mailhog 1.0.1
mysql 8.1.0
mysql@5.7 5.7.43
nginx 1.25.2
openssl@1.1 1.1.1w
php 8.2.11
php@8.1 8.1.24 8.1.23
brew outdated
stripe/stripe-cli/stripe
hashicorp-vagrant
ngrok
brew tap
hashicorp/tap
homebrew/core
homebrew/services
ngrok/ngrok
shivammathur/php
stripe/stripe-cli
php -v
PHP 8.2.10 (cli) (built: Sep  1 2023 00:12:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.10, Copyright (c), by Zend Technologies
which -a php
/Users/carlos/Library/Application Support/Herd/bin//php
/opt/homebrew/bin/php
php --ini
Configuration File (php.ini) Path: /lib
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)
nginx -v
nginx version: nginx/1.25.2
curl --version
curl 7.85.0 (x86_64-apple-darwin22.0) libcurl/7.85.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.47.0
Release-Date: 2022-08-31
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 threadsafe UnixSockets
php --ri curl
curl

cURL support => enabled
cURL Information => 8.2.1
Age => 10
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => No
SPNEGO => No
SSL => Yes
SSPI => No
TLS-SRP => No
HTTP2 => No
GSSAPI => No
KERBEROS5 => No
UNIX_SOCKETS => Yes
PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => No
BROTLI => No
ALTSVC => Yes
HTTP3 => No
UNICODE => No
ZSTD => No
HSTS => Yes
GSASL => No
Protocols => dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, mqtt, pop3, pop3s, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host => Darwin
SSL Version => OpenSSL/3.1.2
ZLib Version => 1.3

Directive => Local Value => Master Value
curl.cainfo => no value => no value
/opt/homebrew/bin/ngrok version
ngrok version 3.3.0
ls -al ~/.ngrok2
total 16
drwx------    4 carlos  staff   128 Dec 10  2022 .
drwxr-xr-x+ 108 carlos  staff  3456 Oct 11 15:33 ..
-rw-------    1 carlos  staff    85 Dec 10  2022 ngrok.yml
-rw-------    1 carlos  staff    61 Dec 10  2022 ngrok.yml.v1.bak
brew info nginx
==> nginx: stable 1.25.2 (bottled), HEAD
HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
https://nginx.org/
/opt/homebrew/Cellar/nginx/1.25.2 (26 files, 2.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-09-07 at 13:56:29
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/n/nginx.rb
License: BSD-2-Clause
==> Dependencies
Required: openssl@3, pcre2
==> Options
--HEAD
    Install HEAD version
==> Caveats
Docroot is: /opt/homebrew/var/www

The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /opt/homebrew/etc/nginx/servers/.

To 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:
  /opt/homebrew/opt/nginx/bin/nginx -g daemon\ off\;
==> Analytics
install: 10,962 (30 days), 42,743 (90 days), 115,518 (365 days)
install-on-request: 10,926 (30 days), 42,652 (90 days), 115,330 (365 days)
build-error: 6 (30 days)
brew info php
==> php: stable 8.2.11 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/opt/homebrew/Cellar/php/8.2.11 (520 files, 83.5MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-10-11 at 15:49:13
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/p/php.rb
License: PHP-3.01
==> Dependencies
Build: httpd, pkg-config
Required: apr, apr-util, argon2, aspell, autoconf, curl, freetds, gd, gettext, gmp, icu4c, krb5, libpq, libsodium, libzip, oniguruma, openldap, openssl@3, 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 /opt/homebrew/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:
    /opt/homebrew/etc/php/8.2/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
==> Analytics
install: 60,912 (30 days), 159,638 (90 days), 363,367 (365 days)
install-on-request: 56,977 (30 days), 148,983 (90 days), 337,501 (365 days)
build-error: 22 (30 days)
brew info openssl
==> openssl@3: stable 3.1.3 (bottled)
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@3/3.1.3 (6,495 files, 28.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-10-11 at 15:48:40
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/o/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
  /opt/homebrew/etc/openssl@3/certs

and run
  /opt/homebrew/opt/openssl@3/bin/c_rehash
==> Analytics
install: 437,494 (30 days), 1,189,712 (90 days), 1,962,355 (365 days)
install-on-request: 55,209 (30 days), 126,199 (90 days), 347,082 (365 days)
build-error: 1,353 (30 days)
openssl version -a
OpenSSL 3.1.3 19 Sep 2023 (Library: OpenSSL 3.1.3 19 Sep 2023)
built on: Tue Sep 19 13:01:49 2023 UTC
platform: darwin64-arm64-cc
options:  bn(64,64)
compiler: clang -fPIC -arch arm64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
OPENSSLDIR: "/opt/homebrew/etc/openssl@3"
ENGINESDIR: "/opt/homebrew/Cellar/openssl@3/3.1.3/lib/engines-3"
MODULESDIR: "/opt/homebrew/Cellar/openssl@3/3.1.3/lib/ossl-modules"
Seeding source: os-specific
CPUINFO: OPENSSL_armcap=0x187d
openssl ciphers
TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:RSA-PSK-AES256-GCM-SHA384:DHE-PSK-AES256-GCM-SHA384:RSA-PSK-CHACHA20-POLY1305:DHE-PSK-CHACHA20-POLY1305:ECDHE-PSK-CHACHA20-POLY1305:AES256-GCM-SHA384:PSK-AES256-GCM-SHA384:PSK-CHACHA20-POLY1305:RSA-PSK-AES128-GCM-SHA256:DHE-PSK-AES128-GCM-SHA256:AES128-GCM-SHA256:PSK-AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:ECDHE-PSK-AES256-CBC-SHA384:ECDHE-PSK-AES256-CBC-SHA:SRP-RSA-AES-256-CBC-SHA:SRP-AES-256-CBC-SHA:RSA-PSK-AES256-CBC-SHA384:DHE-PSK-AES256-CBC-SHA384:RSA-PSK-AES256-CBC-SHA:DHE-PSK-AES256-CBC-SHA:AES256-SHA:PSK-AES256-CBC-SHA384:PSK-AES256-CBC-SHA:ECDHE-PSK-AES128-CBC-SHA256:ECDHE-PSK-AES128-CBC-SHA:SRP-RSA-AES-128-CBC-SHA:SRP-AES-128-CBC-SHA:RSA-PSK-AES128-CBC-SHA256:DHE-PSK-AES128-CBC-SHA256:RSA-PSK-AES128-CBC-SHA:DHE-PSK-AES128-CBC-SHA:AES128-SHA:PSK-AES128-CBC-SHA256:PSK-AES128-CBC-SHA
sudo nginx -t
nginx: the configuration file /opt/homebrew/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /opt/homebrew/etc/nginx/nginx.conf test is successful
which -a php-fpm
/opt/homebrew/sbin/php-fpm
/opt/homebrew/opt/php/sbin/php-fpm -v
PHP 8.2.11 (fpm-fcgi) (built: Sep 28 2023 16:20:55)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies
sudo /opt/homebrew/opt/php/sbin/php-fpm -y /etc/php-fpm.conf --test
[11-Oct-2023 15:52:17] ERROR: failed to open configuration file '/etc/php-fpm.conf': No such file or directory (2)
[11-Oct-2023 15:52:17] ERROR: failed to load configuration file '/etc/php-fpm.conf'
[11-Oct-2023 15:52:17] ERROR: FPM initialization failed
ls -al ~/Library/LaunchAgents | grep homebrew
-rw-r--r--    1 carlos  staff   590 Jun 25  2021 homebrew.mxcl.mailhog.plist
-rw-r--r--@   1 carlos  staff   552 Jun 27 00:13 homebrew.mxcl.mysql.plist
-rw-r--r--    1 carlos  staff   560 Feb 17  2021 homebrew.mxcl.mysql@5.7.plist
-rw-r--r--@   1 carlos  staff   781 May 25 23:58 homebrew.mxcl.php.plist
-rw-r--r--    1 carlos  staff   838 Feb 22  2021 homebrew.mxcl.redis.plist
ls -al /Library/LaunchAgents | grep homebrew

ls -al /Library/LaunchDaemons | grep homebrew
-rw-r--r--@  1 root  admin   797 Oct 11 15:43 homebrew.mxcl.dnsmasq.plist
-rw-r--r--@  1 root  admin   685 Oct 11 15:43 homebrew.mxcl.nginx.plist
-rw-r--r--@  1 root  admin   789 Oct 11 15:43 homebrew.mxcl.php@8.1.plist
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."

ls -aln /etc/resolv.conf
lrwxr-xr-x  1 0  0  22 Dec  2  2022 /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 8.8.8.8
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 
    nd6 options=201
sh -c 'echo "------\n/opt/homebrew/etc/nginx/valet/valet.conf\n---\n"; cat /opt/homebrew/etc/nginx/valet/valet.conf | grep -n "# valet loopback"; echo "\n------\n"'
------
/opt/homebrew/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

------
sh -c 'for file in ~/.config/valet/nginx/*; do echo "------\n~/.config/valet/nginx/$(basename $file)\n---\n"; cat $file | grep -n "# valet loopback"; echo "\n------\n"; done'
------
~/.config/valet/nginx/*
---

cat: /Users/carlos/.config/valet/nginx/*: No such file or directory

------
driesvints commented 11 months ago

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to open up a new issue with a link to the original one and we'll gladly help you out.

Thanks!

drbyte commented 11 months ago

which -a php /Users/carlos/Library/Application Support/Herd/bin//php /opt/homebrew/bin/php

Looks like you have Laravel Herd installed, and its php binary is "first" in your $PATH, and the space in the directory name is causing a problem.

But that issue was fixed in Valet version 4.1.3 via https://github.com/laravel/valet/pull/1431