ubuntu包管理器无法识别php5

时间:2016-11-14 05:19:53

标签: php ubuntu package

我按照以下方式安装了php5。安装看起来成功了。 但是ubuntu包管理器无法识别php5。 我该如何解决这个问题?

这是由于包管理器无法将php5.6识别为php5 ??

引起的

安装php5> https://askubuntu.com/questions/756181/installing-php-5-6-on-xenial-16-04

包网址> https://github.com/dainok/iou-web/blob/master/iou-web_1.2.2-23_all.deb

错误消息

$ ▶ sudo dpkg -i iou-web_1.2.2-23_all.deb 
Selecting previously unselected package iou-web.
(Reading database ... 201383 files and directories currently installed.)
Preparing to unpack iou-web_1.2.2-23_all.deb ...
Unpacking iou-web (1.2.2-23) ...
dpkg: dependency problems prevent configuration of iou-web:
 iou-web depends on php5; however:
  Package php5 is not installed.
 iou-web depends on php5-pspell; however:
  Package php5-pspell is not installed.
 iou-web depends on libgv-php5; however:
  Package libgv-php5 is not installed.
 iou-web depends on php5-sqlite; however:
  Package php5-sqlite is not installed.
 iou-web depends on php-pear; however:
  Package php-pear is not installed.
 iou-web depends on php5-gd; however:
  Package php5-gd is not installed.

dpkg: error processing package iou-web (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 iou-web

PHP版

php -v
PHP 5.6.28-1+deb.sury.org~xenial+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

OS

cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial

apache phpinfo()

PHP Version 5.6.28-1+deb.sury.org~xenial+1
System  Linux penguin-device 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64
Server API  Apache 2.0 Handler
Virtual Directory Support   disabled
Configuration File (php.ini) Path   /etc/php/5.6/apache2
Loaded Configuration File   /etc/php/5.6/apache2/php.ini
Scan this dir for additional .ini files     /etc/php/5.6/apache2/conf.d

dpkg -s php5.6

Package: php5.6
Status: install ok installed
Priority: optional
Section: php
Installed-Size: 277
Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Architecture: all
Version: 5.6.28-1+deb.sury.org~xenial+1
Provides: php
Depends: libapache2-mod-php5.6 | php5.6-fpm | php5.6-cgi, php5.6-common
Description: server-side, HTML-embedded scripting language (metapackage)
 This package is a metapackage that, when installed, guarantees that you
 have at least one of the four server-side versions of the PHP interpreter
 installed. Removing this package won't remove PHP from your system, however
 it may remove other packages that depend on this one.
 .
 PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
 open source general-purpose scripting language that is especially suited
 for web development and can be embedded into HTML.
Homepage: http://www.php.net/

dpkg -s php5

dpkg-query: package 'php5' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

找到php5

/etc/apparmor.d/abstractions/php5

找到php

/etc/apparmor.d/abstractions/php5
/lib/modules/4.4.0-25-generic/kernel/drivers/pci/hotplug/acpiphp_ibm.ko
/lib/modules/4.4.0-47-generic/kernel/drivers/pci/hotplug/acpiphp_ibm.ko
/usr/share/app-install/desktop/gphpedit:gphpedit.desktop
/usr/share/app-install/desktop/slbackup-php:slbackup-php.desktop
/usr/share/app-install/icons/gphpedit.png
/usr/share/gtksourceview-3.0/language-specs/php.lang
/usr/share/icons/Humanity/mimes/16/gnome-mime-application-x-php.svg
/usr/share/icons/Humanity/mimes/22/application-x-php.svg
/usr/share/icons/Humanity/mimes/22/gnome-mime-application-x-php.svg
/usr/share/icons/Humanity/mimes/24/application-x-php.svg
/usr/share/icons/Humanity/mimes/24/gnome-mime-application-x-php.svg
/usr/share/icons/Humanity/mimes/48/application-x-php.svg
/usr/share/icons/Humanity/mimes/48/gnome-mime-application-x-php.svg
/usr/share/icons/aery-icons/mimes/48/application-x-php.svg
/usr/share/icons/elementary-xfce/mimes/128/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/16/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/16/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/22/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/22/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/24/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/24/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/32/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/32/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/48/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/48/gnome-mime-application-x-php.png
/usr/share/icons/elementary-xfce/mimes/64/application-x-php.png
/usr/share/icons/elementary-xfce/mimes/64/gnome-mime-application-x-php.png
/usr/share/icons/gnome/16x16/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/22x22/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/24x24/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/256x256/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-php.png
/usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-x-php.png
/usr/share/lintian/checks/phppear.desc
/usr/share/lintian/checks/phppear.pm
/usr/share/lintian/data/files/php-libraries
/usr/share/mime/application/x-php.xml
/usr/share/nano/php.nanorc
/usr/share/yelp-xsl/js/jquery.syntax.brush.php-script.js
/usr/share/yelp-xsl/js/jquery.syntax.brush.php.js
/var/cache/dictionaries-common/sqspell.php
/var/lib/app-info/icons/ubuntu-xenial-universe/64x64/gphpedit_gphpedit.png

找到php5.6

 no output

找到apache2

/etc/apache2
/etc/apache2/conf-available
/etc/apache2/conf-available/javascript-common.conf
/etc/apparmor.d/abstractions/apache2-common
/usr/share/bash-completion/completions/apache2ctl
/usr/share/lintian/checks/apache2.desc
/usr/share/lintian/checks/apache2.pm

pwd

/etc/php

LS

5.6  7.0

1 个答案:

答案 0 :(得分:0)

我可以自己解决。 问题是PPA问题。

sudo add-apt-repository ppa:ondrej/php
sudo add-apt-repository ppa:ondrej/php5-compat
sudo apt-get update
sudo apt-get install php5
sudo apt-get install -f

php5被此识别。但是没有安装libgv-php5。 但在重启时尝试安装libgv-php5包。 我可以安装这个并完全解决了问题。关于libgv-php5。 我不确定什么是解决方案。也许,重启与解决方案有关。