16.04:Apache2 和 php 不工作!

16.04:Apache2 和 php 不工作!

每次我重新安装 apache2 它就是不起作用 sudo ufw allow in "Apache Full"Skipping adding existing rule Skipping adding existing rule (v6)

另外,在尝试安装 php7.0-mbstring 时,我收到此错误:

    Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.0-mbstring : Depends: php7.0-common (= 7.0.4-7ubuntu2.1) but 7.0.6-13+donate.sury.org~xenial+1 is to be installed
E: Unable to correct problems, you have held broken packages

我尝试按照说明修复损坏的包装,但即使这样也无济于事。希望有人至少能帮助我找到正确的故障。

答案1

这不是错误,用sudo ufw status它检查一下,它只是告诉你该规则已经存在。

最好是通过阅读来熟悉ufw命令行手动的

至于您添加的第二个问题,请确保启用软件包源,然后System Settings --> Software & Updates运行:

sudo apt-get update
sudo apt-get -f install
sudo apt-get dist-upgrade

运行第一和第三条命令可以让你安装新东西时避免麻烦。同样,你只需要使用php-mbstring虚拟包进行安装。所以这已经足够了:

sudo apt-get install php-mbstring

答案2

好的,我遇到了完全相同的问题。我的答案不是很清晰,但确实有效。

  • 首先我安装了 aptitude:sudo apt-get install aptitude
  • 然后我要求 aptitude 安装 php-mbstring:sudo aptitude install php-mbstring
  • 它要求我做出一些选择来安装它,所以我没有接受第一个选择(即“不要安装 php-mbstring”),我接受了第二个选择,即“将一堆 php 模块降级为正确的模块
  • 现在我有 php-mbstring

\o/

相关内容