1

Seems simple, but I have been unable to install any version other then php 7.4 reliably on fedora 33 (32 seems to have the same issue according to remi).

PHP 7.4 is the default install, but the project I need to work is locked to 7.3 atm due to dependencies that don't work in 7.4 yet.

Remi repositories cannot install below 7.4 either, only multiple versions can get 7.3, however if you do that, it also installs 7.4 and although you can tell nginx to use 7.3, cli is locked to 7.4 (I bet you can do something about that, just not sure how, basically gotta use php73 rather then php for cli commands).

Using the wizard for Fedora 33 can show the versions available and how. https://rpms.remirepo.net/wizard/

Is there a way to reliably get php 7.3 working on Fedora 33? I don't mind multi version as long as both cli and fpm can be using the same version.

2 Answers 2

2

Years ago, I choose to provide as single version only version >= default distribution version. So 7.3, 7.4 and 8.0 for F31, 7.4 and 8.0 for F32+

When Software Collections (SCL) were created, allowing multiple versions, I choose to also provide older versions, so 5.6 to 8.0 for F31+

So, indeed, you have to use the SCL for 7.3 on F32+

For FPM you only have to choose the right socket path, you can even run different versions for different sites/projects

For cli, you have to enable the SCL using

scl enable php73 bash

Or using (I prefer this one)

module load php73

Most packaged CLI app in my repository should work fine (composer, phpunit*...) as I ensure that enabled SCL are used (using "#!/usr/bin/env php" as shebang, while /usr/bin/php is always used in official Fedora packages).

Of course, packages requiring PHP >= 7.4 won't work (but I don't think there is any for now).

An alternative way is to install php73-syspaths which provide the /usr/bin/php command, but this package conflicts with php-cli, so you won't be able to install any packaged app.

You can read My PHP Workstation (quite old, probably need to be refreshed)

1
  • Thank you for the info. I was not aware how scl worked before so just a link to read about them within the wizard wasn't enough for me to connect the dots. Regardless once I got it going, its been working great. Thank you for all the hard work you have put into those php packages. Nov 12, 2020 at 14:29
0

I was directed to https://stackoverflow.com/questions/51377847/set-default-version-of-php-in-centos-7 as a solution and it seems to work for fedora 33 as well.

scl enable php73 bash

is what you want to use to set php to refer to php73

The pitfall is not installing composer or other packages that require php, because doing so will install php 7.4 and take over php-cli (you can probably use the scl command again, but the package might not run correctly).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .