valet-linux icon indicating copy to clipboard operation
valet-linux copied to clipboard

Ask: Remove dot [.] on php version

Open halimkun opened this issue 2 years ago • 4 comments

Basic info

Distro (Name and version) PHP Version Valet version
Ex: EndeavourOS multiple 2.3.2
  • [x] I've checked the issue queue and could not find anything similar to my bug.
  • [x] I'm on the latest version of valet-linux (valet --version): <Valet-Linux-Version>
  • [x] I've run valet fix and valet install after updating and before submitting my issue/feature.

What is the problem? I want to create an isolated site with different php versions. here I have several php versions such as php 7.4 8.2 and 8.0 but when I do the valet isolate 80 command the site in question cannot be accessed.

What was supposed to happen? the site should be immediately accessible because when you don't isolate the php version there are no problems whatsoever except for the php versioning where there shouldn't be a dot .

What actually happened? this may be due to a problem when generating valet80.sock because the file cannot be found, according to my observations and the log files that I have seen.

this may be due to writing the version in php,

I use EndeavorOS and install php 8.0 from aur (yay) when I want to run php the version should be php80not php8.0 and the name php fpm should be php80-fpm not php8.0-fpm and because of that when restarting php fpm it definitely doesn't work and it detects that phpx.x-fom isn't installed yet.

How to reproduce this? maybe by fixing writing php version on this Os will fix the problem

What is the solution? I don't know the manual solution when isolating the php version, because this will generate valet80.sock and I haven't been able to do it yet.

but when doing a valet start, I need to do a manual start at first on some required linux packages such as php fpm, nginx, dnsmasq.

as well as restarting the packages when there are changes.

halimkun avatar Apr 15 '23 06:04 halimkun

The problem is that depending on the Package Manager the PHP version names may differ, we try to guess the package name here: https://github.com/cpriego/valet-linux/blob/a8d22a4b51b6540fa03da523ca35d10bc4c83b53/cli/Valet/PhpFpm.php#L521

jmarcher avatar May 26 '23 07:05 jmarcher

There should be no guessing, but correct format for what you're actually using. It should have proper implementation to have proper version format per package manager, as it will cause a lot more problems in the future.

mc0de avatar Jun 02 '23 23:06 mc0de

Not everyone switches between php versions, therefore we need to guess the installed php version for them.

jmarcher avatar Jun 05 '23 15:06 jmarcher

it is not the problem with switching php versions. the issue is that dnf does it in a different way thus needs to handle that separately.

mc0de avatar Jun 05 '23 16:06 mc0de