如何查明使用哪个 RPM 来安装 PHP?

如何查明使用哪个 RPM 来安装 PHP?

我在服务器上安装了 PHP,我想知道它是基于哪个 RPM 构建的(webtaticremi)。我怎样才能找到这个。

另外,我如何知道情况是否以及何时发生变化?

答案1

您可以使用以下rpm命令查找有关特定包的信息:

$ rpm -qi php
Name        : php                          Relocations: (not relocatable)
Version     : 5.3.8                             Vendor: Fedora Project
Release     : 3.fc14                        Build Date: Wed 28 Sep 2011 01:40:37 PM EDT
Install Date: Wed 04 Jul 2012 12:42:03 PM EDT      Build Host: x86-12.phx2.fedoraproject.org
Group       : Development/Languages         Source RPM: php-5.3.8-3.fc14.src.rpm
Size        : 3773261                          License: PHP
Signature   : RSA/SHA256, Wed 28 Sep 2011 10:20:06 AM EDT, Key ID 421caddb97a1071f
Packager    : Fedora Project
URL         : http://www.php.net/
Summary     : PHP scripting language for creating dynamic web sites
Description :
PHP is an HTML-embedded scripting language. PHP attempts to make it
easy for developers to write dynamically generated web pages. PHP also
offers built-in database integration for several commercial and
non-commercial database management systems, so writing a
database-enabled webpage with PHP is fairly simple. The most common
use of PHP coding is probably as a replacement for CGI scripts.

The php package contains the module which adds support for the PHP
language to Apache HTTP Server.

您感兴趣的行是 Source RPM。构建日期也包含在该信息中。

替代可执行文件

如果您碰巧不知道提供给定可执行文件的包的名称,您也可以返回此信息:

$ type -a php
php is /usr/bin/php

$ rpm -qf /usr/bin/php
php-cli-5.3.8-3.fc14.x86_64

答案2

像这样:

[root@jimmy ~]# which php
/usr/bin/php
[root@jimmy ~]# rpm -qf /usr/bin/php
php-cli-5.3.1-1.el5.remi
[root@jimmy ~]# 

然后,如果您想了解有关该软件包的更多信息,请像 slm 所说的那样使用“rpm -qi php”。

答案3

您始终可以rpm使用时间戳检查安装历史记录:

#rpm -qa --last

相关内容