laravel / valet

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

Upgraded to Apple M1 now Valet services are erroring after being resintalled #1444

Closed neilgee closed 1 year ago

neilgee commented 1 year ago

Description

I upgraded to Apple M1 and reinstalled Homebrew so it would correctly install in /opt

I removed old Homebrew intel install.

Then I now uninstalled and re-installed Valet but now services are erroring:

~/Sites ▓▒░ valet restart                                                                               ░▒▓ ✔  18:44:26
Restarting dnsmasq...
Restarting php...
Restarting nginx...
Valet services have been restarted.
 ~/Sites ▓▒░ brew services list                                                                     ░▒▓ ✔  16s  18:44:53
Name    Status       User  File
dnsmasq error  512   root  ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
mailhog started      neilg ~/Library/LaunchAgents/homebrew.mxcl.mailhog.plist
mariadb started      neilg ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx   error  256   root  ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php     error  19968 root  ~/Library/LaunchAgents/homebrew.mxcl.php.plist

Steps To Reproduce

From Intel to M1 - install new Homebrew - remove old Homebrew

Uninstall and Reinstall Valet

Diagnosis

sw_vers
ProductName:   macOS
ProductVersion: 12.6.9
BuildVersion:   21G726
valet --version
Laravel Valet 4.3.0
cat ~/.config/valet/config.json
{
    "tld": "test",
    "paths": [
        "/Users/neilg/Sites"
    ],
    "loopback": "127.0.0.1"
}
cat ~/.composer/composer.json
{
    "require": {
        "squizlabs/php_codesniffer": "*",
        "laravel/valet": "^4.3"
    }
}
composer global diagnose
Changed current directory to /Users/neilg/.composer
Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
require.squizlabs/php_codesniffer : unbound version constraints (*) should be avoided
Checking platform settings: OK
Checking git settings: OK git version 2.37.1
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.3
PHP version: 8.2.10
PHP binary path: /opt/homebrew/Cellar/php/8.2.10/bin/php
OpenSSL version: OpenSSL 3.1.2 1 Aug 2023
cURL version: 8.3.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/3.1.2
zip: extension present, unzip present, 7-Zip not available
composer global outdated
Changed current directory to /Users/neilg/.composer

Direct dependencies required in composer.json:
Everything up to date

Transitive dependencies not required in composer.json:
Everything up to date
ls -al /etc/sudoers.d/
total 16
drwxr-xr-x    4 root  wheel   128 15 Sep 06:58 .
drwxr-xr-x  114 root  wheel  3648 15 Sep 18:43 ..
-rw-r--r--    1 root  wheel    80 26 Oct  2019 brew
-rw-r--r--    1 root  wheel    83 26 Oct  2019 valet
brew config
HOMEBREW_VERSION: 4.1.11
ORIGIN: https://github.com/Homebrew/brew
HEAD: 4afb8e5602f3ecc9edf67a44257d8eceeaa8a108
Last commit: 4 days ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 378fc41abc5a6f6800b205235d0248056fa332b2
Core tap last commit: 7 minutes ago
Core tap branch: master
Core tap JSON: 15 Sep 08:54 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.37.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.1.2 => /usr/bin/curl
macOS: 12.6.9-arm64
CLT: 14.2.0.0.1.1668646533
Xcode: N/A
Rosetta 2: false
brew services list
Name    Status User  File
dnsmasq error  512      root  ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
mailhog started         neilg ~/Library/LaunchAgents/homebrew.mxcl.mailhog.plist
mariadb started         neilg ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx   error  256      root  ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php     error  19968    root  ~/Library/LaunchAgents/homebrew.mxcl.php.plist
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
dnsmasq 2.89
mailhog 1.0.1
mariadb 11.1.2
nginx 1.25.2
openssl@1.1 1.1.1w
php 8.2.10
brew outdated

brew tap
homebrew/bundle
homebrew/core
homebrew/services
shivammathur/php
php -v
PHP 8.2.10 (cli) (built: Aug 31 2023 18:52:27) (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
/opt/homebrew/bin/php
php --ini
Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.2
Loaded Configuration File:         /opt/homebrew/etc/php/8.2/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.2/conf.d
Additional .ini files parsed:      /opt/homebrew/etc/php/8.2/conf.d/error_log.ini,
/opt/homebrew/etc/php/8.2/conf.d/ext-opcache.ini,
/opt/homebrew/etc/php/8.2/conf.d/php-memory-limits.ini
nginx -v
nginx version: nginx/1.25.2
curl --version
curl 8.1.2 (x86_64-apple-darwin21.0) libcurl/8.1.2 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1
Release-Date: 2023-05-30
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.3.0
Age => 10
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
ALTSVC => Yes
HTTP3 => No
UNICODE => No
ZSTD => Yes
HSTS => Yes
GSASL => No
Protocols => dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtmpe, rtmps, rtmpt, rtmpte, rtmpts, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => aarch64-apple-darwin21.6.0
SSL Version => (SecureTransport) OpenSSL/3.1.2
ZLib Version => 1.2.11
libSSH Version => libssh2/1.11.0

Directive => Local Value => Master Value
curl.cainfo => no value => no value
/opt/homebrew/bin/ngrok version
sudo: /opt/homebrew/bin/ngrok: command not found
ls -al ~/.ngrok2
ls: /Users/neilg/.ngrok2: No such file or directory
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-15 at 18:23:06
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 restart nginx after an upgrade:
  brew services restart 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: 18,934 (30 days), 51,511 (90 days), 106,388 (365 days)
install-on-request: 18,898 (30 days), 51,428 (90 days), 106,227 (365 days)
build-error: 1 (30 days)
brew info php
==> php: stable 8.2.10 (bottled), HEAD
General-purpose scripting language
https://www.php.net/
/opt/homebrew/Cellar/php/8.2.10 (520 files, 83.5MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-09-15 at 18:22:02
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: 63,631 (30 days), 157,519 (90 days), 310,661 (365 days)
install-on-request: 59,234 (30 days), 146,445 (90 days), 288,217 (365 days)
build-error: 40 (30 days)
brew info openssl
==> openssl@3: stable 3.1.2 (bottled)
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/opt/homebrew/Cellar/openssl@3/3.1.2 (6,495 files, 28.4MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-09-15 at 16:57:26
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: 357,083 (30 days), 1,084,740 (90 days), 1,569,951 (365 days)
install-on-request: 30,558 (30 days), 125,678 (90 days), 296,347 (365 days)
build-error: 1,582 (30 days)
openssl version -a
OpenSSL 3.1.2 1 Aug 2023 (Library: OpenSSL 3.1.2 1 Aug 2023)
built on: Tue Aug  1 13:36:55 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.2/lib/engines-3"
MODULESDIR: "/opt/homebrew/Cellar/openssl@3/3.1.2/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: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /Users/neilg/.config/valet/Nginx/giig.test:9
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in /Users/neilg/.config/valet/Nginx/giig.test:15
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /Users/neilg/.config/valet/Nginx/learmember.test:9
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in /Users/neilg/.config/valet/Nginx/learmember.test:15
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /Users/neilg/.config/valet/Nginx/oxy.test:9
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in /Users/neilg/.config/valet/Nginx/oxy.test:15
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /Users/neilg/.config/valet/Nginx/schools.test:9
nginx: [warn] the "http2_push_preload" directive is obsolete, ignored in /Users/neilg/.config/valet/Nginx/schools.test:15
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.10 (fpm-fcgi) (built: Aug 31 2023 18:52:29)
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
sudo /opt/homebrew/opt/php/sbin/php-fpm -y /opt/homebrew/etc/php/8.2/php-fpm.conf --test
[15-Sep-2023 18:54:52] NOTICE: configuration file /opt/homebrew/etc/php/8.2/php-fpm.conf test is successful
ls -al ~/Library/LaunchAgents | grep homebrew
-rw-r--r--    1 neilg  staff   797 15 Sep 18:30 homebrew.mxcl.dnsmasq.plist
-rw-r--r--    1 neilg  staff   974 15 Sep 16:58 homebrew.mxcl.mailhog.plist
-rw-r--r--    1 neilg  staff   730 15 Sep 18:37 homebrew.mxcl.mariadb.plist
-rw-r--r--    1 neilg  staff   740 15 Sep 18:32 homebrew.mxcl.mariadb@10.3.plist
-rw-r--r--    1 neilg  staff   685 15 Sep 18:38 homebrew.mxcl.nginx.plist
-rw-r--r--    1 neilg  staff   781 15 Sep 17:40 homebrew.mxcl.php.plist
-rw-r--r--    1 neilg  staff   636 17 Feb  2021 homebrew.mxcl.php@7.3.plist
ls -al /Library/LaunchAgents | grep homebrew

ls -al /Library/LaunchDaemons | grep homebrew
-rw-r--r--   1 root  admin   797 15 Sep 18:44 homebrew.mxcl.dnsmasq.plist
-rw-r--r--   1 root  admin   685 15 Sep 18:44 homebrew.mxcl.nginx.plist
-rw-r--r--   1 root  admin   781 15 Sep 18:44 homebrew.mxcl.php.plist
-rw-r--r--   1 root  wheel   636 18 Feb  2021 homebrew.mxcl.php@7.3.plist
-rw-r--r--   1 root  wheel   636 28 Jun 08:57 homebrew.mxcl.php@7.4.plist
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."

ls -aln /etc/resolv.conf
lrwxr-xr-x  1 0  0  22  4 Sep 17:15 /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 192.168.1.1
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/giig.test
---

3:    #listen 127.0.0.1:80; # valet loopback
10:    #listen 127.0.0.1:443 ssl http2; # valet loopback
54:    #listen 127.0.0.1:60; # valet loopback

------

------
~/.config/valet/nginx/learmember.test
---

3:    #listen 127.0.0.1:80; # valet loopback
10:    #listen 127.0.0.1:443 ssl http2; # valet loopback
54:    #listen 127.0.0.1:60; # valet loopback

------

------
~/.config/valet/nginx/oxy.test
---

3:    #listen 127.0.0.1:80; # valet loopback
10:    #listen 127.0.0.1:443 ssl http2; # valet loopback
54:    #listen 127.0.0.1:60; # valet loopback

------

------
~/.config/valet/nginx/schools.test
---

3:    #listen 127.0.0.1:80; # valet loopback
10:    #listen 127.0.0.1:443 ssl http2; # valet loopback
54:    #listen 127.0.0.1:60; # valet loopback

------
driesvints commented 1 year 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!

neilgee commented 1 year ago

Wow - shutdown so quickly - I can't be the only one who has tried to migrate and failed

drbyte commented 1 year ago

When you look at ls -al ~/Library/LaunchAgents | grep homebrew you'll see that you've got the Valet services running as yourself as well as those running as root in ls -al /Library/LaunchDaemons | grep homebrew.

This is usually caused by manually starting those services without calling sudo, which Valet does.

So, I'd start with running the following to stop the non-root services that are already also running as root:

brew services stop php@7.3
brew services stop php
brew services stop nginx
brew services stop dnsmasq

Then run valet restart.

Does that solve it for you? If not, then further digging will be required ...

drbyte commented 1 year ago

You've also got 2 mariadb instances configured to run:

-rw-r--r--    1 neilg  staff   730 15 Sep 18:37 homebrew.mxcl.mariadb.plist
-rw-r--r--    1 neilg  staff   740 15 Sep 18:32 homebrew.mxcl.mariadb@10.3.plist

I suggest calling brew services stop mariadb@10.3 to stop it from trying to load at login, since the other (non @10.3) appears to be running fine.

drbyte commented 1 year ago

Also @neilgee while you opened this post saying "services are erroring", you didn't indicate whether your Valet sites can be accessed, or whether they are displaying any specific errors. Just curious what other symptoms are going on ... or is it just these errors showing in brew services list?

neilgee commented 1 year ago

Thanks @drbyte for the response.

So I completely uninstalled Valet and Homebrew - then reinstalled but still have the same issues.

 ~/Sites ▓▒░ valet --version                                                                             ░▒▓ ✔  09:27:04
Laravel Valet 4.3.0

Launch agents

 ~/Sites ▓▒░ ls -al ~/Library/LaunchAgents | grep homebrew                                               ░▒▓ ✔  09:24:24
-rw-r--r--    1 neilg  staff   797 16 Sep 09:23 homebrew.mxcl.dnsmasq.plist
-rw-r--r--    1 neilg  staff   974 15 Sep 16:58 homebrew.mxcl.mailhog.plist
-rw-r--r--    1 neilg  staff   730 15 Sep 19:11 homebrew.mxcl.mariadb.plist
-rw-r--r--    1 neilg  staff   685 16 Sep 09:24 homebrew.mxcl.nginx.plist
-rw-r--r--    1 neilg  staff   781 15 Sep 18:56 homebrew.mxcl.php.plist

Launch Daemons

 ~/Sites ▓▒░ ls -al /Library/LaunchDaemons | grep homebrew                                               ░▒▓ ✔  09:25:33
-rw-r--r--   1 root  admin   797 16 Sep 09:19 homebrew.mxcl.dnsmasq.plist
-rw-r--r--   1 root  admin   685 16 Sep 09:19 homebrew.mxcl.nginx.plist
-rw-r--r--   1 root  admin   781 16 Sep 09:19 homebrew.mxcl.php.plist
-rw-r--r--   1 root  wheel   636 18 Feb  2021 homebrew.mxcl.php@7.3.plist
-rw-r--r--   1 root  wheel   636 28 Jun 08:57 homebrew.mxcl.php@7.4.plist

However I still get that error 512 for dnsmasq and 256 for nginx.

Brew services list

 ~/Sites ▓▒░ valet restart                                                                               ░▒▓ ✔  09:33:44
Restarting dnsmasq...
Restarting php...
Restarting nginx...
Valet services have been restarted.

 ~/Sites ▓▒░ brew services list                                                                          ░▒▓ ✔  09:24:14
Name    Status     User  File
dnsmasq error  512 root  ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
mariadb started    neilg ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx   error  256 root  ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php     started    root  ~/Library/LaunchAgents/homebrew.mxcl.php.plist

I have given up on preserving the previous websites - but I'll just import them when I have it up and running.

Everything has been installed without sudo - but I am unsure why brew services list is stating that root is the user for 3/4 of the LaunchAgents

My aim is just to get this up and running

drbyte commented 1 year ago

Okay. Your root LaunchDaemons are fine. But your NeilG LaunchAgents are not. Looks like they were left behind from yesterday/earlier.

Run the following without sudo:

brew services stop dnsmasq
brew services stop nginx
brew services stop php
valet restart
brew services list

After that run ls -al ~/Library/LaunchAgents | grep homebrew and if any of the following are still present, delete them manually and reboot:

-rw-r--r--    1 neilg  staff   797 16 Sep 09:23 homebrew.mxcl.dnsmasq.plist
-rw-r--r--    1 neilg  staff   685 16 Sep 09:24 homebrew.mxcl.nginx.plist
-rw-r--r--    1 neilg  staff   781 15 Sep 18:56 homebrew.mxcl.php.plist

(mailhog and mariadb are fine to run as neilg, just not dnsmasq/nginx/php)

EDIT: Here's a quick delete command for those:

rm ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/homebrew.mxcl.php.plist
neilgee commented 1 year ago

Ok done that and rebooted and the restarted valet - but the service status is set to none:

 ~/Sites ▓▒░ valet restart                                                                               ░▒▓ ✔  11:48:01
Restarting dnsmasq...
Restarting php...
Restarting nginx...
Valet services have been restarted.
 ~/Sites ▓▒░ brew services list                                                                     ░▒▓ ✔  16s  11:48:28
Name    Status  User  File
dnsmasq none    root
mariadb started neilg ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx   none    root
php     none    root

So I started them with brew services and get this:

 ~/Sites ▓▒░ brew services start dnsmasq                                                                 ░▒▓ ✔  11:49:04
Warning: dnsmasq must be run as root to start at system startup!
==> Successfully started `dnsmasq` (label: homebrew.mxcl.dnsmasq)
 ~/Sites ▓▒░ brew services start nginx                                                                   ░▒▓ ✔  11:52:03
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
 ~/Sites ▓▒░                                                                                             ░▒▓ ✔  11:52:11
 ~/Sites ▓▒░ brew services start php                                                                     ░▒▓ ✔  11:52:13
==> Successfully started `php` (label: homebrew.mxcl.php)
 ~/Sites ▓▒░ brew services list                                                                          ░▒▓ ✔  11:52:18
Name    Status       User  File
dnsmasq error  512   root  ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
mariadb started      neilg ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx   error  256   root  ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php     error  19968 root  ~/Library/LaunchAgents/homebrew.mxcl.php.plist

Still getting errors.

neilgee commented 1 year ago

But saying that I can create WordPress sites using https://github.com/aaemnnosttv/wp-cli-valet-command

I can verify PHP, NGINX and DNSMASQ are now working eventhough their status is an error:

 ~/Sites ▓▒░ brew services list                                                                        ░▒▓ 1 х  14:40:50
Name    Status       User  File
dnsmasq error  512   root  ~/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
mariadb started      neilg ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
nginx   error  256   root  ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php     error  19968 root  ~/Library/LaunchAgents/homebrew.mxcl.php.plist

Of course I would prefer the status to be in good standing

drbyte commented 1 year ago

Ya, I've sometimes seen those services show "error" or "none" or even blank but things are working fine. Haven't fully researched why that is...