PHP - How to install the latest version of package?

Viewed 38

I am trying to install the latest extension/package version on PHP.

I have tried the following on both PHP 8.1 and 7.4 and I am getting the same type of error:

sudo apt install php-opcache
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package php-opcache is a virtual package provided by:
  php8.2-opcache 8.2.0~rc1-2+ubuntu22.04.1+deb.sury.org+1
  php8.1-opcache 8.1.10-2+ubuntu22.04.1+deb.sury.org+1
  php8.0-opcache 1:8.0.23-1+ubuntu22.04.1+deb.sury.org+1
  php7.4-opcache 1:7.4.30-6+ubuntu22.04.1+deb.sury.org+1
  php7.3-opcache 7.3.33-6+ubuntu22.04.1+deb.sury.org+1
  php7.2-opcache 7.2.34-34+ubuntu22.04.1+deb.sury.org+1
  php7.1-opcache 7.1.33-49+ubuntu22.04.1+deb.sury.org+1
  php7.0-opcache 7.0.33-62+ubuntu22.04.1+deb.sury.org+1
  php5.6-opcache 5.6.40-62+ubuntu22.04.1+deb.sury.org+1
You should explicitly select one to install.

E: Package 'php-opcache' has no installation candidate

I know that I must specify a version, but isn't there some way around this? I am follwoing FIVE separate tutorials on how to install a particular software on my home server and ALL of them are giving me the option to just install a bulk list of packages - same for the video tutorials around the Internet - not a single one of the instructors are specifying a version - so there must be some kind of solution.

Thank you!

1 Answers

try this apt install php7.4-opcache and for php8 apt install php8.1-opcache

be sure conflicts maybe occurred when using multiple version with multiple project you have to assign version to virtual host

Related