努力在 Centos 上安装 PHP pecl [英] struggling to install PHP pecl on Centos

查看:25
本文介绍了努力在 Centos 上安装 PHP pecl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 CentOS 服务器上安装 php_http PHP 扩展.

I'm trying to install the php_http PHP extension on my CentOS server.

我已经完成了:

yum install php-pear

但是得到:

No package php-pear available

但我可以做到:

pear

并从 Pear 中获取命令列表.

And get a list of commands from Pear.

yum install pecl 也一样.我可以做 peclpecl install pecl_http 返回:

Same for yum install pecl. I can do pecl but pecl install pecl_http returns:

No releases available for package "pecl.php.net/pecl_http"
install failed

然而 /usr/bin/pecl 不是一个存在的目录.还有一个 sudo pecl install pecl_http 返回 sudo: pecl: command not found,我觉得这很奇怪.

Yet /usr/bin/pecl isn't a directory that exists. Also a sudo pecl install pecl_http returns sudo: pecl: command not found, which I find quite odd.

我不完全确定这里发生了什么/我做错了什么.

I'm not entirely sure what's going on here/what I'm doing wrong.

我正在使用以下存储库:

edit: I am using the following repos:

base                         CentOS-6 - Base
epel                         Extra Packages for Enterprise Linux 6 - x86_64
extras                       CentOS-6 - Extras
rpmforge                     RHEL 6 - RPMforge.net - dag
updates                      CentOS-6 - Updates
vz-base                      vz-base
vz-updates                   vz-updates                                                            

推荐答案

在 CentOS 上,

On CentOS,

  1. 如果尚未安装,请安装 PHP Pear:

  1. Install PHP Pear if not installed yet:

# yum install php-pear

  • 如果尚未安装 GCC,请安装:

  • Install GCC if not installed yet:

    # yum install gcc
    

  • 如果尚未安装 cURL,请安装:

  • Install cURL if not installed yet:

    # yum install curl-devel
    

  • 如果尚未安装,请安装以下库:

  • Install following libraries if not installed yet:

    # yum install php-devel
    # yum install zlib-devel
    # yum install pcre-devel
    

  • 开始主安装:

  • Start the main installation:

    # pecl install pecl_http
    

  • 将以下行添加到/etc/php.ini 文件中

  • Add the following line to /etc/php.ini file

    extension=raphf.so
    extension=propro.so
    extension=http.so
    

  • 重启 apache 服务器以便加载扩展

  • Restart apache server so the extension can be loaded

    # service httpd restart
    

  • 您可以查看是否安装成功:

    You can check if it installed successfully or not:

    # pecl list
    

    这篇关于努力在 Centos 上安装 PHP pecl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆