大网数据广告活动
服务器运维问答

Fedora 33/32 - Install PHP 7.3

· 52CE 我爱测

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…

问题原文

原帖链接 · Jordan Ramstad · CC BY-SA 4.0

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.

已采纳解答

原帖链接 · Remi Collet · CC BY-SA 4.0

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)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-11-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。