Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 未能在debian上安装libapache2-mod-php5_Linux_Debian_Mod Php - Fatal编程技术网

Linux 未能在debian上安装libapache2-mod-php5

Linux 未能在debian上安装libapache2-mod-php5,linux,debian,mod-php,Linux,Debian,Mod Php,当我尝试在debian(Linux debian 3.2.0-4-686-pae#1 SMP debian 3.2.41-2 i686 GNU/Linux)上安装libapache2-mod-php5时,我得到以下输出: root@debian:~# apt-get install libapache2-mod-php5 Reading package lists... Done Building dependency tree Reading state information... Done

当我尝试在debian(Linux debian 3.2.0-4-686-pae#1 SMP debian 3.2.41-2 i686 GNU/Linux)上安装libapache2-mod-php5时,我得到以下输出:

root@debian:~# apt-get install libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  apache2-mpm-prefork apache2.2-bin apache2.2-common
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
The following packages will be REMOVED:
  apache2
The following NEW packages will be installed:
  apache2-mpm-prefork apache2.2-bin apache2.2-common libapache2-mod-php5
0 upgraded, 4 newly installed, 1 to remove and 274 not upgraded.
Need to get 0 B/3,728 kB of archives.
After this operation, 12.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 72217 files and directories currently installed.)
Removing apache2 (2.4.25-3+deb9u3) ...
[ ok ] Stopping Apache htcacheclean: apache-htcacheclean.
[ ok ] Stopping Apache httpd web server: apache2.
Processing triggers for man-db (2.7.6.1-2) ...
(Reading database ... 72168 files and directories currently installed.)
Preparing to unpack .../apache2.2-bin_2.2.22-13+deb7u12_i386.deb ...
Unpacking apache2.2-bin (2.2.22-13+deb7u12) ...
dpkg: error processing archive /var/cache/apt/archives/apache2.2-bin_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/lib/apache2/modules/mod_rewrite.so', which is also in package apache2-bin 2.4.25-3+deb9u3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../apache2.2-common_2.2.22-13+deb7u12_i386.deb ...
Unpacking apache2.2-common (2.2.22-13+deb7u12) ...
dpkg: error processing archive /var/cache/apt/archives/apache2.2-common_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2-bin 2.4.25-3+deb9u3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../apache2-mpm-prefork_2.2.22-13+deb7u12_i386.deb ...
Unpacking apache2-mpm-prefork (2.2.22-13+deb7u12) ...
dpkg: error processing archive /var/cache/apt/archives/apache2-mpm-prefork_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/sbin/apache2', which is also in package apache2-bin 2.4.25-3+deb9u3
Selecting previously unselected package libapache2-mod-php5.
Preparing to unpack .../libapache2-mod-php5_5.4.45-0+deb7u14_i386.deb ...
Unpacking libapache2-mod-php5 (5.4.45-0+deb7u14) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 /var/cache/apt/archives/apache2.2-bin_2.2.22-13+deb7u12_i386.deb
 /var/cache/apt/archives/apache2.2-common_2.2.22-13+deb7u12_i386.deb
 /var/cache/apt/archives/apache2-mpm-prefork_2.2.22-13+deb7u12_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@debian:~# sudo apt-get purge apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'apache2-mpm-prefork' is not installed, so not removed
Package 'apache2.2-bin' is not installed, so not removed
Package 'apache2.2-common' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  apache2* apache2-utils* libapache2-mod-php5*
0 upgraded, 0 newly installed, 3 to remove and 274 not upgraded.
1 not fully installed or removed.
After this operation, 9,097 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 72174 files and directories currently installed.)
Removing libapache2-mod-php5 (5.4.45-0+deb7u14) ...
Purging configuration files for libapache2-mod-php5 (5.4.45-0+deb7u14) ...
Purging configuration files for apache2 (2.4.25-3+deb9u3) ...
dpkg: warning: while removing apache2, directory '/var/www' not empty so not removed
Removing apache2-utils (2.4.25-3+deb9u3) ...
Processing triggers for man-db (2.7.6.1-2) ...
root@debian:~# apt-get install libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common
Suggested packages:
  apache2-doc apache2-suexec apache2-suexec-custom
The following NEW packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common libapache2-mod-php5
0 upgraded, 5 newly installed, 0 to remove and 274 not upgraded.
Need to get 0 B/3,950 kB of archives.
After this operation, 13.2 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 71981 files and directories currently installed.)
Preparing to unpack .../apache2.2-bin_2.2.22-13+deb7u12_i386.deb ...
Unpacking apache2.2-bin (2.2.22-13+deb7u12) ...
dpkg: error processing archive /var/cache/apt/archives/apache2.2-bin_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/lib/apache2/modules/mod_rewrite.so', which is also in package apache2-bin 2.4.25-3+deb9u3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package apache2-utils.
Preparing to unpack .../apache2-utils_2.4.25-3+deb9u3_i386.deb ...
Unpacking apache2-utils (2.4.25-3+deb9u3) ...
Preparing to unpack .../apache2.2-common_2.2.22-13+deb7u12_i386.deb ...
Unpacking apache2.2-common (2.2.22-13+deb7u12) ...
dpkg: error processing archive /var/cache/apt/archives/apache2.2-common_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2-bin 2.4.25-3+deb9u3
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../apache2-mpm-prefork_2.2.22-13+deb7u12_i386.deb ...
Unpacking apache2-mpm-prefork (2.2.22-13+deb7u12) ...
dpkg: error processing archive /var/cache/apt/archives/apache2-mpm-prefork_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/sbin/apache2', which is also in package apache2-bin 2.4.25-3+deb9u3
Selecting previously unselected package libapache2-mod-php5.
Preparing to unpack .../libapache2-mod-php5_5.4.45-0+deb7u14_i386.deb ...
Unpacking libapache2-mod-php5 (5.4.45-0+deb7u14) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 /var/cache/apt/archives/apache2.2-bin_2.2.22-13+deb7u12_i386.deb
 /var/cache/apt/archives/apache2.2-common_2.2.22-13+deb7u12_i386.deb
 /var/cache/apt/archives/apache2-mpm-prefork_2.2.22-13+deb7u12_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
这就是我之前是否安装了apache2


有什么想法吗?提前谢谢

您应该首先调用apt get autoremove,正如apt工具告诉您的那样

The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data
Use 'apt-get autoremove' to remove them.
由于您的问题似乎来自不同apache版本的文件之间的冲突,更具体地说,来自不再使用的旧安装

dpkg: error processing archive /var/cache/apt/archives/apache2.2-bin_2.2.22-13+deb7u12_i386.deb (--unpack):
 trying to overwrite '/usr/lib/apache2/modules/mod_rewrite.so', which is also in package apache2-bin 2.4.25-3+deb9u3

您似乎正在尝试安装Apache2.2,而Apache2.4已经安装。通常情况下,包之间的冲突应该自动处理,但您可能会看到这个问题,因为您的系统很长时间没有更新。我会先尝试升级,然后再尝试安装。或者您是从其他来源安装apache 2.4的?这可能是系统早就应该升级的问题。我会试试的。