【发布时间】:2016-01-21 06:36:12
【问题描述】:
我正在使用 Amazon Linux AMI。我已经安装了 PHP5.4。
php -v
给予
PHP 5.4.13 (cli) (built: Mar 29 2013 20:29:42)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
当我做pear -V
PEAR Version: 1.10.1
PHP Version: 5.3.29
Zend Engine Version: 2.3.0
Running on: Linux ip-10-0-1-160 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64
pecl -V 给了
PEAR Version: 1.10.1
PHP Version: 5.3.29
Zend Engine Version: 2.3.0
Running on: Linux ip-10-0-1-160 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64
我的问题是pear和pecl命令中显示的PHP版本与php -v不同
当我使用pecl <module> 安装另一个模块时,它给出了
Warning: PHP Startup: <module>: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
编辑
我发现有两个php安装
/usr/bin/php -v 给了
PHP 5.3.29 (cli) (built: May 12 2015 22:42:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
和
/usr/local/bin/php -v给了
PHP 5.4.13 (cli) (built: Mar 29 2013 20:29:42)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
我想使用 PHP 5.4 版本并使用 pear 和 pecl 安装模块。我该怎么做?
【问题讨论】:
-
你用 Yum 安装了 pecl 吗?大多数 pecl 包都在 Yum 中分发……使用 AWS Linux,您甚至可以使用 IUS Repos 来获得更多 PHP 扩展。 iuscommunity.org 我会清除通过 pecl CLI 安装的所有 pecl 扩展并使用 Yum...如果通过 Yum 安装 PHP,它们将与您的 PHP 版本一致
-
我用的是百胜。正如我在编辑中提到的,有两个版本的 php.ini。如何使用 PHP 5.4 配置和安装 pear 和 pecl,然后尝试安装模块。
-
我会删除其中一个 php 安装...您要安装的模块是什么?
-
我正在尝试安装gearman.org
-
这不是一个编程问题,因此这里是题外话。也就是说,设置一台新机器并安装了最近的 PHP,而不是很久没有收到 安全更新 的机器。然后,将您的基础架构迁移到新机器上,最后回收旧机器(如果新机器正常)。