2016-11-14 69 views
2

我按照以下方法安裝了php5。安裝看起來成功。 但是ubuntu軟件包管理器不能識別php5。 我該如何解決這個問題?Ubuntu的包管理器不承認php5

這是由於包管理器無法識別php5.6爲php5的原因造成的?

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

包URL> 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 

阿帕奇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 <[email protected]> 
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 
+0

「php -v」顯示什麼? – Mox

+0

php -v說。它的PHP 5.6.28-1 + deb.sury.org〜xenial + 1(cli) – Takoyaki

+0

由於安裝了php,那麼apache呢? – Mox

回答

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。 我不確定什麼是解決方案。也許,重新啓動與解決方案有關。