-
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 php
can't be defined to run on a site linked to a name different than its directory
#1367
Comments
For reference, I can get this to work by running:
|
I can't reproduce this issue. Here are the steps I took to try to reproduce this. Notice I'm seeing Valet 3.3.3 because I'm working on $ valet --version
Laravel Valet 3.3.3
$ cd /tmp
$ mkdir issue-1367
$ cd issue-1367
$ valet link
A [issue-1367] symbolic link has been created in [/Users/mattstauffer/.config/valet/Sites/issue-1367].
$ php -v
PHP 8.2.1 (cli) (built: Jan 12 2023 19:14:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.1, Copyright (c) Zend Technologies
with Zend OPcache v8.2.1, Copyright (c), by Zend Technologies
$ valet isolate [email protected]
Updating PHP configuration for [email protected]...
Restarting [email protected]...
Restarting nginx...
The site [issue-1367.test] is now using [email protected].
$ valet php -v
PHP 8.1.14 (cli) (built: Jan 12 2023 19:52:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.14, Copyright (c) Zend Technologies
with Zend OPcache v8.1.14, Copyright (c), by Zend Technologies |
Whoops, I just realized you said "isolate your site with a custom name." Let me check that out. |
valet php
uses incorrect version if outside main directoryvalet php
uses incorrect version if outside main directory and linked with a different name than their folder
I'm actually surprised to get this error: I think in my mind i didn't expect you to be able to mkdir /tmp/issue-1367
cd /tmp/issue-1367
valet link isolate-php80
valet link isolate-php81
valet isolate --site=isolate-php80 [email protected]
valet isolate --site=isolate-php81 [email protected] I then set Lo and behold... we can have two different sites using the same local folder isolated to two different versions of PHP. 🤯 Thinking "out loud".. I think I expected this behavior:
Now I'm trying to think if that's viable if we're also supporting this idea that different links to the same site can be isolated differently. |
valet php
uses incorrect version if outside main directory and linked with a different name than their foldervalet php
can't be defined to run on a site linked to a name different than its directory
OK, so this has nothing to do with the main parked directory or not. Here's what it is: Lines 82 to 87 in 044bdc1
Solving this would require, I think, writing code in Bash to parse I understand why you want this feature... it seems in sync with the ability to isolate each link to a folder uniquely......... I just don't think it's worth it. 😬 But I'll keep thinking about it and see if I can come up with a simple solution. |
@scrummitch Would you test this PR out please? #1370 |
@mattstauffer Its a bit of a weird solution because the
LGTM |
Tested Composer and it is working too :) |
Thanks @scrummitch! As a user of this, do you think it would be a pain if it only works if |
I have would expected it to be the first parameter, otherwise it will get confused with the php and composer argument list. Your decision seems the correct one. |
Description:
If I want to run a php command such as:
valet php -S 0.0.0.0:3030 -t ./public
it will use the default installed /usr/bin/php rather than the isolated php version if my site is isolated.It would be preferred if I could pick my php version or name the site when running php commands like this, for example:
valet php --site=mycustomsite -S 0.0.0.0:3030 -t ./public
ORvalet php [email protected] -S 0.0.0.0:3030 -t ./public
Steps To Reproduce:
In a folder OUTSIDE of your normally parked folder, or on a subdomain, isolate a site with a custom name and then run
valet php -v
, you will see that it does not use the isolated php version.Diagnosis
This is not related to an internal issue that would be solvable using
diagnose
The text was updated successfully, but these errors were encountered: