genesisweb / valet-linux-plus

Advanced local development experience for Linux.
MIT License
148 stars 26 forks source link

after update from 1.6.3 to 1.6.6 value stop work #101

Open hosamalzagh opened 1 year ago

hosamalzagh commented 1 year ago

valet update
There is a new release of Valet Linux Updating now... Changed current directory to /home/predo/.config/composer Loading composer repositories with package information Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies Lock file operations: 0 installs, 1 update, 0 removals

In Pacman.php line 85:

Pacman was unable to install [php82-fpm].


my os is arch


╰─❯ valet --version ValetLinux+ v1.6.6


i try valet use php8-fpm | valet use php | php8| php82

Changing php version...

In Systemd.php line 224:

Unable to determine service name.


php -v
PHP 8.2.5 (cli) (built: Apr 12 2023 15:55:38) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.5, Copyright (c) Zend Technologies


i try put this /etc/pacman.conf [home_el_archphp_Arch] Server = https://download.opensuse.org/repositories/home:/el:/archphp/Arch/$arch

valet use 82 Changing php version... [php82-fpm] is not installed, installing it now via Pacman warning: database file for 'home_el_archphp_Arch' does not exist (use '-Sy' to download) error: target not found: php82-fpm

╰─❯ valet use 8
Changing php version... [php8-fpm] is not installed, installing it now via Pacman warning: database file for 'home_el_archphp_Arch' does not exist (use '-Sy' to download) error: target not found: php8-fpm

@uttamrabadiya

uttamrabadiya commented 1 year ago

@hosamalzagh I forgot to mention further steps, could you please try below steps and confirm if it works

Run the following command to store the PHP key and fingerprint variables:

key=$(curl -fsSL https://download.opensuse.org/repositories/home:el:archphp/Arch/$(uname -m)/home_el_archphp_Arch.key)
fingerprint=$(gpg --quiet --with-colons --import-options show-only --import --fingerprint <<< "${key}" | awk -F: '$1 == "fpr" { print $10 }')

Next, initialize the key with the following command:

pacman-key --init

Next, add the key and fingerprint with the following command:

pacman-key --add - <<< "${key}"
pacman-key --lsign-key "${fingerprint}"

Finally, update the repository with the following command:

pacman -Syy

After this, valet use 8.2 should work fine for you.

Thanks!

hosamalzagh commented 1 year ago

@uttamrabadiya befor you replay i edit /home/predo/.config/composer/vendor/genesisweb/valet-linux-plus/cli/Valet/PackageManagers/Pacman.php i add public $latest = 82;

edit public function getPhpFpmName($version) { $pattern = !empty(self::PHP_FPM_PATTERN_BY_VERSION[$version]) ? self::PHP_FPM_PATTERN_BY_VERSION[$version] : 'php{VERSION_WITHOUT_DOT}-fpm'; $version = preg_replace('~[^\d]~', '', $version);

    $version = $version == $this->latest ? '':$version;

    return str_replace('{VERSION_WITHOUT_DOT}', $version, $pattern);
}

he work fine

i will try your replay abow and tell you
hosamalzagh commented 1 year ago

It seems that the code is searching for a service named "php82-fpm", but in Arch Linux, the service is named "php-fpm".

this code key=$(curl -fsSL https://download.opensuse.org/repositories/home:el:archphp/Arch/$(uname -m)/home_el_archphp_Arch.key) fingerprint=$(gpg --quiet --with-colons --import-options show-only --import --fingerprint <<< "${key}" | awk -F: '$1 == "fpr" { print $10 }')

not work