简体   繁体   English

PHP - 如何安装最新版本的 package?

[英]PHP - How to install the latest version of package?

I am trying to install the latest extension/package version on PHP.我正在尝试在 PHP 上安装最新的扩展/包版本。

I have tried the following on both PHP 8.1 and 7.4 and I am getting the same type of error:我在 PHP 8.1 和 7.4 上都尝试了以下操作,我得到了相同类型的错误:

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!谢谢!

try this apt install php7.4-opcache and for php8 apt install php8.1-opcache试试这个 apt install php7.4-opcache 和 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确保在多个项目中使用多个版本时可能会发生冲突,您必须将版本分配给虚拟主机

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在命令行中使用composer安装软件包的最新版本? - How to install the latest version of a package using composer in the command line? 如何使用Composer安装最新的PHP次要分支版本 - How install the latest PHP minor branch version with composer 如何在Debian 8(Jessie)上安装最新版本的PHP 5.4? - How to install the latest version of PHP 5.4 on Debian 8 (Jessie)? PHP pecl已包含:如何编译和安装最新版本 - PHP pecl inclued: How to compile and install very latest version 在PHP Composer中,配置依赖项以安装仍与当前平台或框架兼容的软件包的最新版本。 - In PHP Composer, configure dependencies to install the latest version of the package which is still compatible with the current platform or framework Composer 始终安装最新版本,如果 package 版本由逻辑或分隔 - Composer always install the latest version, if the package version separated by logical OR 我如何配置xampp以安装最新版本的php version 7.1的php mongo驱动程序并从php脚本连接到mongodb - How can i configure xampp to install php mongo driver for latest version of php version 7.1 and connect to mongodb from php script 如何使用composer在分支中安装最新版本? - how to install the latest version in a branch with composer? 如何安装最新版Laravel 8.x - How to install the latest version of Laravel 8.x 作曲家。 如何根据用户php版本安装特定版本的软件包? - Composer. How to install a specific version of package based on user php version?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM