我正忙于为我的网站设置ec2。我正在使用Ubuntu 18.04 AMI(Amazon Machine Image)。我需要运行以下命令:
sudo apt-get install php7.0 php7.0-mcrypt php7.0-mysql mysql-server
apache2
但是当我尝试执行安装时,出现以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php7.0-remctl' for regex 'php7.0'
Note, selecting 'php7.0-common' for regex 'php7.0'
Note, selecting 'php-remctl' instead of 'php7.0-remctl'
E: Unable to locate package libapache2-mod-php7.0
E: Couldn't find any package by glob 'libapache2-mod-php7.0'
E: Couldn't find any package by regex 'libapache2-mod-php7.0'
E: Unable to locate package php7.0-mysql
E: Couldn't find any package by glob 'php7.0-mysql'
E: Couldn't find any package by regex 'php7.0-mysql'
我正在Windows 10上通过MobaXterm运行这些命令。有什么想法我做错了吗?
答案 0 :(得分:1)
PHP 7.0已过时-it reached end-of-life in January 2019-在Ubuntu 18.04中不可用。此版本的合适版本是PHP 7.2(例如php7.2
,php7.2-mysql
等);您将需要相应地更改安装命令。
mcrypt扩展名was deprecated in PHP 7.1,随后是removed in PHP 7.2。如果您在应用程序中使用此扩展名,请you will need to rework those parts of your code。