Skip to content
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

Bug: Cannot switch PHP versions #349

Closed
3 tasks done
dima2306 opened this issue Dec 13, 2021 · 5 comments
Closed
3 tasks done

Bug: Cannot switch PHP versions #349

dima2306 opened this issue Dec 13, 2021 · 5 comments

Comments

@dima2306
Copy link

dima2306 commented Dec 13, 2021

Basic info

Distro (Name and version) PHP Version Valet version
Fedora 35 8.0.13 2.2.29
  • I've checked the issue queue and could not find anything similar to my bug.
  • I'm on the latest version of valet-linux (valet --version): 2.2.29
  • I've run valet fix and valet install after updating and before submitting my issue/feature.

What is the problem?
Cannot switch PHP versions using valet use <version>

What was supposed to happen?
PHP version should have been changed.

What actually happened?
I think nothing. As I'm still getting errors caused by the new PHP 8 version.

How to reproduce this?
As Fedora 35 comes with PHP 8 by default, I used this wizard to install PHP 7.4.
There is also another source of how to install PHP 7.4 on Fedora 35: https://computingforgeeks.com/how-to-install-php-74-on-fedora but I have no luck following that tutorial.

The main fact is that 7.4 is installed on the system and the php74 --version command proves this:

PHP 7.4.26 (cli) (built: Nov 16 2021 15:31:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

And after changing the PHP version to 7.4 using the valet use 74-php command I get the info:

Changing php-fpm version...
This does not affect php -v.
Stopping php74-php-fpm...
Disabling php74-php-fpm...
Php74-php-fpm has been disabled
Php74-php-fpm was already disabled
Restarting php74-php-fpm...
Enabling php74-php-fpm...
Php74-php-fpm has been enabled
php-fpm version successfully changed! 🎉

What is the solution?
N/A

Maybe I'm missing something. Can someone guide me on how to change PHP version?

@dima2306
Copy link
Author

Any news regarding this?

@jmarcher
Copy link
Collaborator

That looks like a weird syntax for valet use, please note that this command uses the version part as an alias for the package manager if the package php<version>-fpm (note the pattern) does not exists there is not much we can do.

@dima2306
Copy link
Author

Hey, @jmarcher Thanks for the reply.

Yes, I noticed the pattern and this is why I pass "74-php" to valet use. Currently in my system PHP 7.4 is present like this:

php74-runtime-1.0-3.fc35.remi.x86_64
php74-php-pecl-grpc-1.43.0~RC1-1.fc35.remi.x86_64
php74-1.0-3.fc35.remi.x86_64
php74-php-pecl-mysql-1.0.0-0.24.20201210.6ca4fa4.fc35.remi.x86_64
php74-php-json-7.4.27-1.fc35.remi.x86_64
php74-php-common-7.4.27-1.fc35.remi.x86_64
php74-php-pdo-7.4.27-1.fc35.remi.x86_64
php74-php-cli-7.4.27-1.fc35.remi.x86_64
php74-php-fpm-7.4.27-1.fc35.remi.x86_64
php74-php-mbstring-7.4.27-1.fc35.remi.x86_64
php74-php-opcache-7.4.27-1.fc35.remi.x86_64
php74-php-sodium-7.4.27-1.fc35.remi.x86_64
php74-php-xml-7.4.27-1.fc35.remi.x86_64
php74-php-7.4.27-1.fc35.remi.x86_64
php74-php-mysqlnd-7.4.27-1.fc35.remi.x86_64

This is the report of rpm -qa | grep php74.

So what else can I do, valet still uses 8.0.x

@dima2306
Copy link
Author

@jmarcher Hey,
Maybe you can merge this PR here also?
laravel#1192
laravel#1198
laravel#1201

I've some company projects which can't run newer PHP/Laravel versions. So, I'm stuck with old ones and literally, this is what I need, to serve some apps with specific PHP version.

Will appreciate the updates from you or any other maintainer in the free time.

@jmarcher
Copy link
Collaborator

Thanks, I do not have the time at the moment to merge that code.
Note that is not that simple because our codebase is already very different

I really want to see this on Valet-Linux, when I find the time will add it for sure, but if someone has the time right now it would help a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants