pecl install pecl_http не предоставляет никаких выпусков - PullRequest
4 голосов
/ 03 декабря 2011

Я пытаюсь установить расширение pecl HTTPRequest.Но когда я запускаю следующую команду на своем сервере CentOS, я получаю сообщение о том, что выпуски недоступны и установка не удалась.

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

Что я делаю не так?

Редактировать: Pecl config

    Configuration (channel pecl.php.net):
=====================================
Auto-discover new Channels     auto_discover    <not set>
Default Channel                default_channel  pecl.php.net
HTTP Proxy Server Address      http_proxy       <not set>
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pecl.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          /usr/local/bin
PEAR documentation directory   doc_dir          /usr/local/lib/php/doc
PHP extension directory        ext_dir          ./
PEAR directory                 php_dir          /usr/local/lib/php
PEAR Installer cache directory cache_dir        /tmp/pear/cache
PEAR configuration file        cfg_dir          /usr/local/lib/php/cfg
directory
PEAR data directory            data_dir         /usr/local/lib/php/data
PEAR Installer download        download_dir     /tmp/pear/download
directory
PHP CLI/CGI binary             php_bin          /usr/local/bin/php
php.ini location               php_ini          <not set>
--program-prefix passed to     php_prefix       <not set>
PHP's ./configure
--program-suffix passed to     php_suffix       <not set>
PHP's ./configure
PEAR Installer temp directory  temp_dir         /tmp/pear/temp
PEAR test directory            test_dir         /usr/local/lib/php/test
PEAR www files directory       www_dir          /usr/local/lib/php/htdocs
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            22
Debug Log Level                verbose          1
PEAR password (for             password         <not set>
maintainers)
Signature Handling Program     sig_bin          /usr/bin/gpg
Signature Key Directory        sig_keydir       /usr/local/etc/pearkeys
Signature Key Id               sig_keyid        <not set>
Package Signature Type         sig_type         gpg
PEAR username (for             username         <not set>
maintainers)
User Configuration File        Filename         /home/onsboek/.pearrc
System Configuration File      Filename         /usr/local/etc/pear.conf

Ответы [ 2 ]

1 голос
/ 24 апреля 2014

В моем случае возникла проблема: pecl.php.net не ответил, когда заголовок «Accept-Encoding:» был полностью пуст.

Добавление одного единственного пробела к этой строке в исходном коде груши решило проблему.

файл: /usr/local/lib/php/PEAR/REST.php

строка ~ 405

$request .= "AcceptEncoding:\r\n";            //<---original line
$request .= "AcceptEncoding: \r\n";           //<--changed to this (added space)

... или простой скрипт может выполнить изменение:

#!/usr/bin/env bash
target=`pecl config-get php_dir`/PEAR/REST.php
        [ -f "$target" ] || { echo file $target not found; exit; }
sed -i 's/Accept-Encoding:\\r\\n/AcceptEncoding: \\r\\n/g' $target
0 голосов
/ 04 июня 2013

Попробуйте следующее;

yum install php-pear
yum install gcc
yum install curl-devel
/usr/bin/pecl install pecl_http

Добавьте следующую строку в файл /etc/php.ini: расширение = http.so

Перезагрузите сервер apache, чтобы можно было загрузить расширение:

httpd -k restart

Если это не сработает, дайте мне знать результат.

...