简体   繁体   English

无法将PHP7安装到AWS EC2实例?

[英]Cannot install PHP7 to AWS EC2 instance?

I have successfully installed apache 2.4.34 onto my instance but I am unable to install PHP7. 我已经成功将apache 2.4.34安装到我的实例上,但是无法安装PHP7。 I have tried the following: 我尝试了以下方法:

 sudo yum install php70

But I get the following error: 但是我收到以下错误:

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
No package php70 available.
Error: Nothing to do

It could be possible that you are missing the right name. 您可能会缺少正确的名称。 Check what php version is there with the command: 使用以下命令检查php版本:

yum search php70

After that you should see a php version name. 之后,您应该看到一个php版本名称。 Copy and paste it to your command like: 将其复制并粘贴到您的命令中,例如:

yum install <php version name>

Make sure you put the whole php version name and don't forget to restart your apache!!! 确保您输入了整个php版本名称,并且不要忘记重新启动apache !!!

apt-get update && apt-get upgrade
apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php<Your desired version>

通过运行以下命令确认已安装: php -V

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM