php Ubuntu Apache:“模块 php7 不存在”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36057615/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:41:01  来源:igfitidea点击:

Ubuntu Apache: "Module php7 does not exist"

phpapacheubuntudigital-ocean

提问by atorscho

I am trying to upgrade PHP 5.5.9 to PHP 7 on my DigitalOcean Ubuntu 14.04 machine.

我正在尝试在我的 DigitalOcean Ubuntu 14.04 机器上将 PHP 5.5.9 升级到 PHP 7。

I've read many tutorials and articles how to do it, but each of them misses something. For example, somewhere they say you must sudo a2dismod php5then sudo a2enmod php7. The problem is that I always get this message

我已经阅读了很多教程和文章如何做到这一点,但他们每个人都错过了一些东西。例如,在某个地方他们说你必须sudo a2dismod php5then sudo a2enmod php7。问题是我总是收到这条消息

$ sudo a2enmod php7
ERROR: Module php7 does not exist!

Does someone one how to resolve this problem, please?

请问有人如何解决这个问题?

Thanks in advance.

提前致谢。

回答by atorscho

Finally, thanks to the comment of Ed de Almeida, I found the solution.

最后,感谢 Ed de Almeida 的评论,我找到了解决方案。

I had to install an additional package:

我不得不安装一个额外的包:

$ sudo apt-get install libapache2-mod-php7.0

Now I could run sudo a2enmod php7.0.

现在我可以跑了sudo a2enmod php7.0