搜尋
首頁後端開發php教程ubuntu16.04 php安裝失敗,提示依賴關係使得php7.0 的設定工作無法繼續

在ubuntu16.04上安裝php7.0提示這個:

<code>pcd@pcd-All-Series:~/桌面$ sudo apt-get install php7.0
[sudo] pcd 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
php7.0 已经是最新版 (7.0.10-2+deb.sury.org~xenial+1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 3 个软件包没有被完全安装或卸载。
解压缩后会消耗 0 B 的额外空间。
您希望继续执行吗? [Y/n] y
正在设置 libapache2-mod-php7.0 (7.0.10-2+deb.sury.org~xenial+1) ...
Not replacing deleted config file /etc/php/7.0/apache2/php.ini
php_invoke: Enable module xmlwriter for apache2 sapi
php_invoke: Enable module xml for apache2 sapi
php_invoke: Enable module fileinfo for apache2 sapi
php_invoke: Enable module shmop for apache2 sapi
php_invoke: Enable module calendar for apache2 sapi
php_invoke: Enable module sysvsem for apache2 sapi
php_invoke: Enable module exif for apache2 sapi
php_invoke: Enable module xmlreader for apache2 sapi
php_invoke: Enable module json for apache2 sapi
php_invoke: Enable module tokenizer for apache2 sapi
php_invoke: Enable module simplexml for apache2 sapi
php_invoke: Enable module dom for apache2 sapi
php_invoke: Enable module posix for apache2 sapi
php_invoke: Enable module gettext for apache2 sapi
php_invoke: Enable module sysvmsg for apache2 sapi
php_invoke: Enable module sysvshm for apache2 sapi
php_invoke: Enable module wddx for apache2 sapi
php_invoke: Enable module xsl for apache2 sapi
php_invoke: Enable module readline for apache2 sapi
php_invoke: Enable module ctype for apache2 sapi
php_invoke: Enable module phar for apache2 sapi
php_invoke: Enable module ftp for apache2 sapi
php_invoke: Enable module opcache for apache2 sapi
php_invoke: Enable module pdo for apache2 sapi
php_invoke: Enable module sockets for apache2 sapi
php_invoke: Enable module iconv for apache2 sapi
dpkg: 处理软件包 libapache2-mod-php7.0 (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
正在设置 php7.0-fpm (7.0.10-2+deb.sury.org~xenial+1) ...
Not replacing deleted config file /etc/php/7.0/fpm/php.ini
php_invoke: Enable module xmlwriter for fpm sapi
php_invoke: Enable module xml for fpm sapi
php_invoke: Enable module fileinfo for fpm sapi
php_invoke: Enable module shmop for fpm sapi
php_invoke: Enable module calendar for fpm sapi
php_invoke: Enable module sysvsem for fpm sapi
php_invoke: Enable module exif for fpm sapi
php_invoke: Enable module xmlreader for fpm sapi
php_invoke: Enable module json for fpm sapi
php_invoke: Enable module tokenizer for fpm sapi
php_invoke: Enable module simplexml for fpm sapi
php_invoke: Enable module dom for fpm sapi
php_invoke: Enable module posix for fpm sapi
php_invoke: Enable module gettext for fpm sapi
php_invoke: Enable module sysvmsg for fpm sapi
php_invoke: Enable module sysvshm for fpm sapi
php_invoke: Enable module wddx for fpm sapi
php_invoke: Enable module xsl for fpm sapi
php_invoke: Enable module readline for fpm sapi
php_invoke: Enable module ctype for fpm sapi
php_invoke: Enable module phar for fpm sapi
php_invoke: Enable module ftp for fpm sapi
php_invoke: Enable module opcache for fpm sapi
php_invoke: Enable module pdo for fpm sapi
php_invoke: Enable module sockets for fpm sapi
php_invoke: Enable module iconv for fpm sapi
NOTICE: Not enabling PHP 7.0 FPM by default.
NOTICE: To enable PHP 7.0 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.0-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
initctl: 无法连接到 Upstart: Failed to connect to socket /com/ubuntu/upstart: 拒绝连接
insserv: warning: script 'scrapyd' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `scrapyd'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `scrapyd'
Job for php7.0-fpm.service failed because the control process exited with error code. See "systemctl status php7.0-fpm.service" and "journalctl -xe" for details.
invoke-rc.d: initscript php7.0-fpm, action "restart" failed.
dpkg: 处理软件包 php7.0-fpm (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
dpkg: 依赖关系问题使得 php7.0 的配置工作不能继续:
 php7.0 依赖于 libapache2-mod-php7.0 | php7.0-fpm | php7.0-cgi;然而:
  软件包 libapache2-mod-php7.0 尚未配置。
  软件包 php7.0-fpm 尚未配置。
  未安装软件包 php7.0-cgi。

dpkg: 处理软件包 php7.0 (--configure)时出错:
 依赖关系问题 - 仍未被配置
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
                                                                    在处理时有错误发生:
 libapache2-mod-php7.0
 php7.0-fpm
 php7.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
pcd@pcd-All-Series:~/桌面$ 
</code>

在這種情況下,我安裝其他php相關的軟體也是這樣,由於設定工作不能繼續,真的無法解決了,來請教一下這裡的大神

回覆內容:

在ubuntu16.04上安裝php7.0提示這個:

<code>pcd@pcd-All-Series:~/桌面$ sudo apt-get install php7.0
[sudo] pcd 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
php7.0 已经是最新版 (7.0.10-2+deb.sury.org~xenial+1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
有 3 个软件包没有被完全安装或卸载。
解压缩后会消耗 0 B 的额外空间。
您希望继续执行吗? [Y/n] y
正在设置 libapache2-mod-php7.0 (7.0.10-2+deb.sury.org~xenial+1) ...
Not replacing deleted config file /etc/php/7.0/apache2/php.ini
php_invoke: Enable module xmlwriter for apache2 sapi
php_invoke: Enable module xml for apache2 sapi
php_invoke: Enable module fileinfo for apache2 sapi
php_invoke: Enable module shmop for apache2 sapi
php_invoke: Enable module calendar for apache2 sapi
php_invoke: Enable module sysvsem for apache2 sapi
php_invoke: Enable module exif for apache2 sapi
php_invoke: Enable module xmlreader for apache2 sapi
php_invoke: Enable module json for apache2 sapi
php_invoke: Enable module tokenizer for apache2 sapi
php_invoke: Enable module simplexml for apache2 sapi
php_invoke: Enable module dom for apache2 sapi
php_invoke: Enable module posix for apache2 sapi
php_invoke: Enable module gettext for apache2 sapi
php_invoke: Enable module sysvmsg for apache2 sapi
php_invoke: Enable module sysvshm for apache2 sapi
php_invoke: Enable module wddx for apache2 sapi
php_invoke: Enable module xsl for apache2 sapi
php_invoke: Enable module readline for apache2 sapi
php_invoke: Enable module ctype for apache2 sapi
php_invoke: Enable module phar for apache2 sapi
php_invoke: Enable module ftp for apache2 sapi
php_invoke: Enable module opcache for apache2 sapi
php_invoke: Enable module pdo for apache2 sapi
php_invoke: Enable module sockets for apache2 sapi
php_invoke: Enable module iconv for apache2 sapi
dpkg: 处理软件包 libapache2-mod-php7.0 (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
正在设置 php7.0-fpm (7.0.10-2+deb.sury.org~xenial+1) ...
Not replacing deleted config file /etc/php/7.0/fpm/php.ini
php_invoke: Enable module xmlwriter for fpm sapi
php_invoke: Enable module xml for fpm sapi
php_invoke: Enable module fileinfo for fpm sapi
php_invoke: Enable module shmop for fpm sapi
php_invoke: Enable module calendar for fpm sapi
php_invoke: Enable module sysvsem for fpm sapi
php_invoke: Enable module exif for fpm sapi
php_invoke: Enable module xmlreader for fpm sapi
php_invoke: Enable module json for fpm sapi
php_invoke: Enable module tokenizer for fpm sapi
php_invoke: Enable module simplexml for fpm sapi
php_invoke: Enable module dom for fpm sapi
php_invoke: Enable module posix for fpm sapi
php_invoke: Enable module gettext for fpm sapi
php_invoke: Enable module sysvmsg for fpm sapi
php_invoke: Enable module sysvshm for fpm sapi
php_invoke: Enable module wddx for fpm sapi
php_invoke: Enable module xsl for fpm sapi
php_invoke: Enable module readline for fpm sapi
php_invoke: Enable module ctype for fpm sapi
php_invoke: Enable module phar for fpm sapi
php_invoke: Enable module ftp for fpm sapi
php_invoke: Enable module opcache for fpm sapi
php_invoke: Enable module pdo for fpm sapi
php_invoke: Enable module sockets for fpm sapi
php_invoke: Enable module iconv for fpm sapi
NOTICE: Not enabling PHP 7.0 FPM by default.
NOTICE: To enable PHP 7.0 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.0-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
initctl: 无法连接到 Upstart: Failed to connect to socket /com/ubuntu/upstart: 拒绝连接
insserv: warning: script 'scrapyd' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `scrapyd'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `scrapyd'
Job for php7.0-fpm.service failed because the control process exited with error code. See "systemctl status php7.0-fpm.service" and "journalctl -xe" for details.
invoke-rc.d: initscript php7.0-fpm, action "restart" failed.
dpkg: 处理软件包 php7.0-fpm (--configure)时出错:
 子进程 已安装 post-installation 脚本 返回错误状态 1
dpkg: 依赖关系问题使得 php7.0 的配置工作不能继续:
 php7.0 依赖于 libapache2-mod-php7.0 | php7.0-fpm | php7.0-cgi;然而:
  软件包 libapache2-mod-php7.0 尚未配置。
  软件包 php7.0-fpm 尚未配置。
  未安装软件包 php7.0-cgi。

dpkg: 处理软件包 php7.0 (--configure)时出错:
 依赖关系问题 - 仍未被配置
因为错误消息指示这是由于上一个问题导致的错误,没有写入 apport 报告。
                                                                    在处理时有错误发生:
 libapache2-mod-php7.0
 php7.0-fpm
 php7.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
pcd@pcd-All-Series:~/桌面$ 
</code>

在這種情況下,我安裝其他php相關的軟體也是這樣,由於設定工作不能繼續,真的無法解決了,來請教一下這裡的大神

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bak //現在將info資料夾更名
sudo mkdir /var/lib/dpkg/info //再新建一個新的info資料夾
sudo apt-get install libapache2-mod-php7.0
sudo apt-get install php7.0-fpm
sudo apt-get install php7.0
sudo mv /var/lib/dpkg/info.bak /var/lib. /dpkg/info

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么实现几秒后执行一个函数php怎么实现几秒后执行一个函数Apr 24, 2022 pm 01:12 PM

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php字符串有没有下标php字符串有没有下标Apr 24, 2022 am 11:49 AM

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

php怎么除以100保留两位小数php怎么除以100保留两位小数Apr 22, 2022 pm 06:23 PM

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

php怎么读取字符串后几个字符php怎么读取字符串后几个字符Apr 22, 2022 pm 08:31 PM

在php中,可以使用substr()函数来读取字符串后几个字符,只需要将该函数的第二个参数设置为负值,第三个参数省略即可;语法为“substr(字符串,-n)”,表示读取从字符串结尾处向前数第n个字符开始,直到字符串结尾的全部字符。

php怎么根据年月日判断是一年的第几天php怎么根据年月日判断是一年的第几天Apr 22, 2022 pm 05:02 PM

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php怎么替换nbsp空格符php怎么替换nbsp空格符Apr 24, 2022 pm 02:55 PM

方法:1、用“str_replace("&nbsp;","其他字符",$str)”语句,可将nbsp符替换为其他字符;2、用“preg_replace("/(\s|\&nbsp\;||\xc2\xa0)/","其他字符",$str)”语句。

php怎么查找字符串是第几位php怎么查找字符串是第几位Apr 22, 2022 pm 06:48 PM

查找方法:1、用strpos(),语法“strpos("字符串值","查找子串")+1”;2、用stripos(),语法“strpos("字符串值","查找子串")+1”。因为字符串是从0开始计数的,因此两个函数获取的位置需要进行加1处理。

See all articles

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

AI Hentai Generator

AI Hentai Generator

免費產生 AI 無盡。

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳圖形設置
3 週前By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您聽不到任何人,如何修復音頻
3 週前By尊渡假赌尊渡假赌尊渡假赌

熱工具

mPDF

mPDF

mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

SublimeText3 英文版

SublimeText3 英文版

推薦:為Win版本,支援程式碼提示!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

強大的PHP整合開發環境

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境