-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valet 502 Error working with PostgreSQL and MongoDB #1433
Comments
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! |
I've been looking for a solution all day in every forum and even reinstalling macOS, if I use SESSION_DRIVER other than database valet was OK |
and if anyone has same problem, just switch back to valet v4.1.2 and session_driver=database was runing good. thanks |
@monoland You will probably find those details in |
I've finally had time to test the situation described, and cannot replicate the problem, using both Valet 4.1.2 and 4.1.3. cd ~/Sites
laravel new foo
cd foo
valet open
sed -i '' 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/' .env
sed -i '' 's/DB_DATABASE=/#DB_DATABASE=/' .env
touch database/database.sqlite
php artisan session:table
php artisan migrate
valet open
brew services start mariadb
mysqld -uroot -p ##logged in and created database
sed -i '' 's/DB_CONNECTION=sqlite/DB_CONNECTION=mysql/' .env
sed -i '' 's/\#DB_DATABASE=/DB_DATABASE=/' .env
php artisan migrate:fresh
valet open |
Having the same problem. Works fine, when served via Problems also happens on 4.1.2, so probably not a valet problem, but any help is appreciated :) valet log php-fpm -f --lines=20
valet log nginx -f --lines=10
sw_versProductName: macOS ProductVersion: 13.4.1 ProductVersionExtra: (c) BuildVersion: 22F770820d valet --versionLaravel Valet 4.1.3 cat ~/.config/valet/config.json{ "tld": "test", "loopback": "127.0.0.1", "paths": [ "/Users/danielthoma/.config/valet/Sites", "/Users/danielthoma/git/clickbar", "/Users/danielthoma/git/konaktiva", "/Users/danielthoma/git/private" ] } cat ~/.composer/composer.json{ "require": { "laravel/installer": "^4.4", "laravel/valet": "^4.1", "tightenco/takeout": "^2.4" } } composer global diagnoseChanged current directory to /Users/danielthoma/.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.41.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: FAIL Missing pubkey for tags verification Missing pubkey for dev verification Run composer self-update --update-keys to set them up Checking composer version: OK Composer version: 2.5.8 PHP version: 8.2.8 PHP binary path: /opt/homebrew/Cellar/php/8.2.8/bin/php OpenSSL version: OpenSSL 3.1.1 30 May 2023 cURL version: 8.2.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/3.1.1 zip: extension present, unzip present, 7-Zip not available composer global outdatedChanged current directory to /Users/danielthoma/.composer Legend: ! patch or minor release available - update recommended ~ major release available - update possible ls -al /etc/sudoers.d/total 0 drwxr-xr-x 2 root wheel 64 Jun 15 12:08 . drwxr-xr-x 80 root wheel 2560 Jul 16 14:28 .. brew configHOMEBREW_VERSION: 4.1.0 ORIGIN: https://github.com/Homebrew/brew HEAD: ac93842f8d13913f462aedb246cfacd08d6b7f05 Last commit: 4 days ago Core tap origin: https://github.com/Homebrew/homebrew-core Core tap HEAD: eb3088f5a5ebd859a4999f1d1f2403b9e6f88126 Core tap last commit: 5 months ago Core tap branch: master Core tap JSON: 23 Jul 21:39 UTC HOMEBREW_PREFIX: /opt/homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 8 Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby CPU: octa-core 64-bit arm_firestorm_icestorm Clang: 14.0.3 build 1403 Git: 2.41.0 => /opt/homebrew/bin/git Curl: 7.88.1 => /usr/bin/curl macOS: 13.4.1-arm64 CLT: 14.3.1.0.1.1683849156 Xcode: N/A Rosetta 2: false brew services listName Status User File dnsmasq none root meilisearch none nginx none root openvpn none php started root ~/Library/LaunchAgents/homebrew.mxcl.php.plist [email protected] none postgresql@14 none stripe-mock none unbound none brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"dnsmasq 2.87 2.89 2.88 2.86 nginx 1.25.1_1 1.25.1 [email protected] 1.1.1u php 8.1.12 8.2.7 8.2.8 8.2.6 8.1.3_1 8.2.7_1 8.1.7 8.1.10 8.1.11 8.2.3 8.2.4 8.2.5 8.2.7_2 8.1.10_1 8.1.5 [email protected] 8.1.21 8.1.14_1 brew outdatedbrew taphomebrew/bundle homebrew/cask homebrew/cask-fonts homebrew/cask-versions homebrew/core homebrew/services nicoverbruggen/cask oven-sh/bun stripe/stripe-cli stripe/stripe-mock traildb/judy php -vPHP 8.2.8 (cli) (built: Jul 6 2023 10:57:44) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.8, Copyright (c) Zend Technologies with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans with Zend OPcache v8.2.8, Copyright (c), by Zend Technologies which -a php/opt/homebrew/bin/php php --iniConfiguration 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/99-memprof.ini, /opt/homebrew/etc/php/8.2/conf.d/99-xdebug.ini, /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 -vnginx version: nginx/1.25.1 curl --versioncurl 7.88.1 (x86_64-apple-darwin22.0) libcurl/7.88.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0 Release-Date: 2023-02-20 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 curlcurl /opt/homebrew/bin/ngrok versionsudo: /opt/homebrew/bin/ngrok: command not found ls -al ~/.ngrok2ls: /Users/danielthoma/.ngrok2: No such file or directory brew info nginx==> nginx: stable 1.25.1 (bottled), HEAD HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server https://nginx.org/ /opt/homebrew/Cellar/nginx/1.25.1 (23 files, 2.4MB) Built from source /opt/homebrew/Cellar/nginx/1.25.1_1 (26 files, 2.4MB) * Poured from bottle using the formulae.brew.sh API on 2023-06-29 at 09:37:25 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nginx.rb License: BSD-2-Clause ==> Dependencies Required: openssl@3, pcre2 ==> Options --HEAD Install HEAD version ==> Caveats Docroot is: /opt/homebrew/var/www brew info php==> php: stable 8.2.8 (bottled), HEAD General-purpose scripting language https://www.php.net/ /opt/homebrew/Cellar/php/8.1.3_1 (510 files, 81.6MB) Built from source /opt/homebrew/Cellar/php/8.1.5 (510 files, 81.6MB) Built from source /opt/homebrew/Cellar/php/8.1.7 (510 files, 81.7MB) Built from source /opt/homebrew/Cellar/php/8.1.10 (510 files, 81.7MB) Built from source /opt/homebrew/Cellar/php/8.1.10_1 (510 files, 81.7MB) Built from source /opt/homebrew/Cellar/php/8.1.11 (510 files, 81.6MB) Built from source /opt/homebrew/Cellar/php/8.1.12 (510 files, 81.6MB) Built from source /opt/homebrew/Cellar/php/8.2.3 (517 files, 83.3MB) Built from source /opt/homebrew/Cellar/php/8.2.4 (516 files, 83.3MB) Built from source /opt/homebrew/Cellar/php/8.2.5 (517 files, 83.4MB) Built from source /opt/homebrew/Cellar/php/8.2.6 (517 files, 83.4MB) Built from source /opt/homebrew/Cellar/php/8.2.7 (517 files, 83.4MB) Built from source /opt/homebrew/Cellar/php/8.2.7_1 (517 files, 83.4MB) Built from source /opt/homebrew/Cellar/php/8.2.7_2 (517 files, 83.4MB) Built from source /opt/homebrew/Cellar/php/8.2.8 (520 files, 83.5MB) * Poured from bottle using the formulae.brew.sh API on 2023-07-11 at 13:09:28 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, 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 brew info openssl==> openssl@3: stable 3.1.1 (bottled) Cryptography and SSL/TLS Toolkit https://openssl.org/ /opt/homebrew/Cellar/openssl@3/3.1.1_1 (6,495 files, 28.4MB) * Poured from bottle using the formulae.brew.sh API on 2023-06-29 at 09:36:57 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected] 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 openssl version -aOpenSSL 1.1.1t 7 Feb 2023 built on: Mon Feb 13 23:21:47 2023 UTC platform: darwin64-arm64-cc options: bn(64,64) rc4(int) des(int) idea(int) blowfish(ptr) compiler: arm64-apple-darwin20.0.0-clang -D_FORTIFY_SOURCE=2 -isystem /opt/homebrew/Caskroom/miniconda/base/include -mmacosx-version-min=11.1 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/homebrew/Caskroom/miniconda/base/include -fdebug-prefix-map=/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_ccl4lztlvr/croot/openssl_1676330477401/work=/usr/local/src/conda/openssl-1.1.1t -fdebug-prefix-map=/opt/homebrew/Caskroom/miniconda/base=/usr/local/src/conda-prefix -fPIC -arch arm64 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /opt/homebrew/Caskroom/miniconda/base/include -fdebug-prefix-map=/var/folders/nz/j6p8yfhx1mv_0grj5xl4650h0000gp/T/abs_ccl4lztlvr/croot/openssl_1676330477401/work=/usr/local/src/conda/openssl-1.1.1t -fdebug-prefix-map=/opt/homebrew/Caskroom/miniconda/base=/usr/local/src/conda-prefix -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -D_REENTRANT -DNDEBUG -D_FORTIFY_SOURCE=2 -isystem /opt/homebrew/Caskroom/miniconda/base/include -mmacosx-version-min=11.1 OPENSSLDIR: "/opt/homebrew/Caskroom/miniconda/base/ssl" ENGINESDIR: "/opt/homebrew/Caskroom/miniconda/base/lib/engines-1.1" Seeding source: os-specific openssl ciphersTLS_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 -tnginx: 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 -vPHP 8.2.8 (fpm-fcgi) (built: Jul 6 2023 10:57:47) Copyright (c) The PHP Group Zend Engine v4.2.8, Copyright (c) Zend Technologies with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans with Zend OPcache v8.2.8, Copyright (c), by Zend Technologies sudo /opt/homebrew/opt/php/sbin/php-fpm -y /opt/homebrew/etc/php/8.2/php-fpm.conf --test[23-Jul-2023 23:39:39] 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 danielthoma staff 586 Mar 24 2022 homebrew.mxcl.php.plist ls -al /Library/LaunchAgents | grep homebrewls -al /Library/LaunchDaemons | grep homebrew-rw-r--r-- 1 root admin 797 Jul 23 23:04 homebrew.mxcl.dnsmasq.plist -rw-r--r-- 1 root admin 685 Jul 23 23:04 homebrew.mxcl.nginx.plist -rw-r--r-- 1 root admin 781 Jul 23 23:04 homebrew.mxcl.php.plist ls -al /Library/LaunchDaemons | grep "com.laravel.valet."ls -aln /etc/resolv.conflrwxr-xr-x 1 0 0 22 Jun 15 12:08 /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. # search fritz.box nameserver 1.1.1.1 nameserver 8.8.8.8 ifconfig lo0lo0: 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 --- 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 --- 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/* --- |
this my nginx error log 2023/07/24 07:06:16 [error] 1957#0: *2 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: backend.citragroup.test, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/Users/monoland/.config/valet/valet.sock:", host: "backend.citragroup.test" |
@djfhe my-problem appear when I install redis on my-machine |
Having the same problem. The error only happens when a PostgreSQL query is executed. I did not use the session driver. |
We'll need a clear way to reproduce this one otherwise it's gonna be a shot in the dark at figuring out how to solve it. |
I also struggled with this for the last days and was not able to resolve it. All laravel projects which were using pgsql resulted in 502 and the error message mentioned here. It may have something to do with Homebrew/homebrew-core#137431. Even though the fix mentioned there did not work for me and the My current 'workaround' is to use Herd, since pgsql extension was included there recently. Apparently their php build does not include the |
Sure, it is straightforward to reproduce: https://github.com/tpetry/laravel-valet-bug-1433 The only change to a stock Laravel installation is that the php artisan serveworks perfectly! valet linkfails with nginx 502 error, no information in php-fpm error log.
|
I'm working on getting Postgres working on my local machine after a while of not using it; will test as soon as I have it running. Update: I ran So this isn't a core Valet issue, as I think we're all assuming. I'm going to assume it's some dependency that y'all have a newer version of than me. Let me work on updating them all bit by bit. Possible things that have been mentioned:
I don't have any m2 machines so if it's that I'll need help. I'm going to update all my dependencies and see if I can possibly trigger this; if not, I'll install Herd and see if it causes the problem; if not, M2 is my next angle. |
I am on an M1 machine and haven't installed Herd yet.
|
Same issue, even tried in a fresh m2 machine (nothing installed other than valet and neccessary stuff to run a Laravel project), on a fresh laravel project it fails once I set the database driver to pgsql, dame nginx logs as the ones pointed in other comments |
OK, @tpetry has disproved the Herd hypothesis and the M2 hypothesis. Let's see what else we can find out... |
Is it specific to a certain php or nginx version?
|
I guess that the problem started after brew updated my dependencies. But I am not sure. I hadn't been developing for some days and the day I started to develop again I've installed a new brew package - which updated everything. Again, just a guess. |
I'm running on a pre-m1 iMac; I'll run these tests on my m1 laptop again later. I ran I'm currently on PHP 8.2.8, Valet 4.1.3, and nginx 1.25.1, same as @tpetry, but can't repro the problem. @tpetry What tool are you using to install your Postgres? I'm using postgres.app, but maybe if I use the same one you're using that'll help us be in better parity? To be clear, what I'm testing is:
|
I am using a PG 14 version of StackBricks. But the Postgres version shouldn't be the problem. Because for a PG issue the |
Update: I tried all these same steps on my m1 laptop, same inability to reproduce. ... until I restarted my computer! Now I can reproduce! Let me try restarting my non-m1.... yep. So.. it's not m1 related either. Update homebrew, restart computer, suddenly seeing the problem. Now let's dive into why... |
While it's unknown here yet which "upstream" host/phase is actually the "delay" or causing the "disconnect", perhaps (even just temporarily for troubleshooting) adjusting the nginx config may help expose more errors in other logs: Add new file:
... and |
EDIT: after digging into nginx source, I'm pretty sure However, if the |
@monoland FYI, in your Check the following again: ls -al ~/Library/LaunchAgents | grep homebrew
ls -al ~/Library/LaunchDaemons | grep homebrew You don't want a PHP process running in LaunchAgents. Only in LaunchDaemons. To fix that, simply run (without sudo): |
I notice the same Due to the pattern showing for both, I wonder: Does that solve the reported issue? |
Stopped LaunchAgents (
Sadly the problem still persists and there are no new entries logged. valet log php-fpm -f
valet log nginx -f
valet status
Versions:
|
PHP has 2 binaries/executables: |
I understand your point, but what prevents PHP developers from taking the PDO internals from cli and replacing them in PHP-FPM. I also tried to run without PHP-FPM using FastCGI - it doesn't work.
I changed plist: OBJC_DISABLE_INITIALIZE_FORK_SAFETY = YES |
Was having issues with route model binding (both Implicit and explicit) where I'd either get the 502 error or Laravel would initialize a blank instance of a model instead of looking up the existing one. This only occurred if Valet was serving the site. If I used the built in Updating <key>EnvironmentVariables</key>
<dict>
<key>OBJC_DISABLE_INITIALIZE_FORK_SAFETY</key>
<string>YES</string>
</dict> Thank you so much for reminding me that this issue causes a lot of havoc @askdkc ! |
Found a solution here: Homebrew/homebrew-core#137431 (comment) |
Note that for Valet, the .conf filename would be different. Valet uses the php-fpm pool defined in |
[10-Sep-2023 17:27:02] WARNING: [pool valet] child 8482 exited on signal 9 (SIGKILL) after 16.588784 seconds from start I am getting this error for laravel valet with postgres |
@efureev Here solution, But I'm not sure which one make it work. Or all of them. Add this code to
Add this code to
Then |
@ThunderBirdsX3 thx! but I'm helped following:
And restart php. It works fine. |
My path is slightly different with it being (#1433 (comment) Lifesaver!) Thanks for this again! I had fixed it on my machine a few months ago but had to reinstall Valet and it all fell apart. |
Is anyone willing to PR a fix? |
Many have reported that these changes "do" help the problem. And yet many others have reported that they make no difference. Closes laravel#1433 This PR is merely a bandage for a broader problem that exists in the PHP build for MacOS. See the issue referenced above for discussion and links to Homebrew and PHP repository discussions. The problem is not in Homebrew, but in the PHP build published by the PHP core. Chime in on the PHP discussion if you want to stir up more active participation for a proper fix, telling them that you're a Mac user encountering the fork segfaults (they won't care whether you're using Valet, but they will recognize if you mention Homebrew).
thanks! |
Ref - Homebrew/homebrew-core#137431 (comment) This worked for me: Add the following lines to your
And restart your effected PHP service, or test in running it directly: /usr/local/opt/[email protected]/sbin/php-fpm --nodaemonize Needed this on all mine PHP versions, to make it work:
|
The second part of this answer worked for me! Thanks for sharing! |
Closing this since a PR is up. Thanks all. |
on my mac, the file location of Homebrew is in
try this if you can not find in |
If you're using Homebrew and this solution doesn't fix the issue for you, please make sure you're modifying What I mean by that is, in my case, I had the following file structure: Those extra packages were created when I was trying to switch and link the |
thx for ur help |
Hey guys. If any other comment didnt fix your issue; you can add next lines in
|
The workaround/fix is already built-in to Valet since v4.6.0. See #1452 |
Just a follow up: My problem start after installed PostgreSQL, but i've remove everthing and still not working. After digging just found out that my problem is because this package https://github.com/beyondcode/laravel-dump-server and https://github.com/symfony/var-dumper was really what cause me problem, if i've started Just for anyone that have similar problem. |
Description
502 Bad Gateway
Steps To Reproduce
php artisan session:table
php artisan migrate
edit SESSION_DRIVER=database on .env
Diagnosis
sw_vers
valet --version
cat ~/.config/valet/config.json
cat ~/.composer/composer.json
composer global diagnose
composer global outdated
ls -al /etc/sudoers.d/
brew config
brew services list
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
brew outdated
brew tap
php -v
which -a php
php --ini
nginx -v
curl --version
php --ri curl
/usr/local/bin/ngrok version
ls -al ~/.ngrok2
brew info nginx
brew info php
brew info openssl
openssl version -a
openssl ciphers
sudo nginx -t
which -a php-fpm
/usr/local/opt/php/sbin/php-fpm -v
sudo /usr/local/opt/php/sbin/php-fpm -y /usr/local/etc/php/8.2/php-fpm.conf --test
ls -al ~/Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchDaemons | grep homebrew
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."
ls -aln /etc/resolv.conf
cat /etc/resolv.conf
ifconfig lo0
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"'
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'
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'
The text was updated successfully, but these errors were encountered: