-
Notifications
You must be signed in to change notification settings - Fork 702
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 fails to find valid .valetphprc #1336
Comments
Why are you doing this? |
I guess you don't really need to, I just wanted to make sure that the global php version and the expected new version didn't match to make it easier to see if it works. |
An alternate solution would just be to make sure the php version specified in the |
I'm the work colleague mentioned above, and I am also the original contributor of the I've done some investigating and on my personal MacBook where running The following line of code seems to be the culprit: Line 1162 in 8246ee6
|
@MeMattStone can you send in a PR? |
Yes of course, I'll do a bit more testing to verify a solution and submit a PR |
@MeMattStone unsure if related, but I have the same setup and after isolating a site I lose access to the 'valet php' and 'valet composer' commands. Running either of these returns "Sorry,: command not found". These commands run as expected on unisolated sites |
This will be fixed in the upcoming v4 release: #1347 |
Sorry to be a pain @driesvints but #1347 didn't actually solve that issue, it just added a second file that can be used for these sorts of configs. Still curious to get @MeMattStone's input! |
Sorry for delay in getting a PR up for this, I think I've figured out the issue but need to do a bit more testing so will share my findings are submit a PR soon |
@MeMattStone no worries! :) |
I tried to reproduce this using my local branch of Valet v4, in which I don't think I modified this behavior: php -v # Outputs PHP 8.1.14
cd /tmp
mkdir linkme
cd linkme
mkdir public
echo "<?php echo phpversion();" > public/index.php
echo "[email protected]" > .valetphprc
valet link
valet use # Found 'linkme/.valetrc' or 'linkme/.valetphprc' specifying version: [email protected]
valet php -v # [email protected]
php -v # [email protected]
valet use [email protected]
valet isolate # Found 'linkme/.valetrc' or 'linkme/.valetphprc' specifying version: [email protected]
valet php -v # [email protected]
php -v # [email protected] I'll try the same thing on a Valet 3 branch shortly. |
OK, Valet v3, on the same directory from my previous comment: valet -v # Laravel Valet 3.3.0
php -v # [email protected]
valet isolate # outputs two lines??? this is strange!
# Found 'linkme/.valetphprc' specifying version:
# Found 'linkme/.valetphprc' specifying version: [email protected]
php -v # [email protected]
valet php -v # [email protected]
valet unisolate
valet use # Found 'linkme/.valetphprc' specifying version: [email protected]
php -v # [email protected]
valet php -v # [email protected] So other than the weird double-output when isolating, it seems to work fine for me. Am I doing it wrong? |
I'll try this issue again with no parked directories maybe? |
Nope. With no parked directories, and only linked directories, I still can't get it to fail. |
@mattstauffer I guess we can close this now? |
Hi, I'm currently re-verifying with @MeMattStone, I think there may be an element of human error here, give me a little bit to confirm and I'll close the branch if it's not a problem :) |
Hey, I was incorrect in my last comment, I can definitely still recreate this issue on my machine. What's interesting is that I can get it to work if I add some parked domains, so it appears to be something on line 1162 where |
@mikeybinns Can you uninstall Valet, restart your computer, reinstall Valet, and keep track of the steps between a fresh install and being able to reproduce this issue? Thanks! |
Okay, I've discovered what the issue is. When we link our sites at work, we use the command Where this falls over is if we make the site name different than the root folder name. Because What doesn't make sense is how it's trying to find the This also explains why this broke for me after updating from v2 to v3, as v3 was when the Because of the above discovery, I think there's 2 changes that need to happen.
Updated steps to reproduce: |
@mikeybinns @MeMattStone Can y'all test out this PR for me? |
@mattstauffer I just downloaded your PR branch and then tested Valet use, it works for me. |
@mikeybinns Working for me too |
Fantastic. I'm going to merge it then! |
Description:
Both of the valet use and valet isolate command are failing to find the valid .valetphprc file in the project root.
I have tested with my colleague this, and it fails on both of our work macs with the following setup:
My work mac (fails)
valet version 3.2.2
Composer version 2.3.1 and 2.5.1 (tried both)
Arm mac on Ventura 13.1
His work mac (fails)
valet version 3.1.6
Composer version 2.5.1
Arm mac on Monterey 12.6
His personal mac (works)
valet version 3.1.6
Composer version 2.3.1
Intel mac on Ventura 13.1
Steps To Reproduce:
Update to v3.2.2
Navigate in terminal to project root
create
.valetphprc
and use the contents [email protected]run
valet use [email protected]
, this sets the php version to something different than what's in the.valetphprc
file.run
valet use
run
valet isolate
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
~/.composer/vendor/laravel/valet/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
/opt/homebrew/opt/php/sbin/php-fpm -v
sudo /opt/homebrew/opt/php/sbin/php-fpm -y /opt/homebrew/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/opt/homebrew/etc/nginx/valet/valet.conf\n---\n"; cat /opt/homebrew/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: