在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

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

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

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

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

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

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

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

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


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

禅工作室 13.0.1
功能强大的PHP集成开发环境

Atom编辑器mac版下载
最流行的的开源编辑器

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

Dreamweaver Mac版
视觉化网页开发工具