【问题标题】:ubuntu package manager doesn't recognize php5ubuntu 包管理器无法识别 php5
【发布时间】:2017-03-27 17:01:47
【问题描述】:

我通过以下方式安装了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

操作系统

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

密码

/etc/php

ls

5.6  7.0

【问题讨论】:

  • “php -v”显示什么?
  • php -v 说。它的 PHP 5.6.28-1+deb.sury.org~xenial+1 (cli)
  • 既然安装了php,那么apache呢?
  • apache 工作正常。它似乎识别 php5.6。我会更新日志
  • 顺便说一句,请包含一个你下载包的网址。我好像在网上的任何地方都找不到它

标签: php ubuntu package


【解决方案1】:

我可能会自己解决。 问题是 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。 我不确定什么是解决方案。也许,重启与解决方案有关。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多