[英]pecl install pecl_http gives no releases available
我正在嘗試安裝pecl HTTPRequest擴展。 但是當我在CentOS服務器上運行以下命令時,我收到的消息是沒有可用的版本,安裝失敗。
$pecl install pecl_http
No releases available for package "pecl.php.net/pecl_http"
install failed
我究竟做錯了什么?
編輯:Pecl配置
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
在我的情況下,有一個問題:當標題“Accept-Encoding:”總是為空時,pecl.php.net沒有回答。
在pear源代碼中為該行添加一個空格,解決了一個問題。
file:/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
嘗試以下方法;
yum install php-pear
yum install gcc
yum install curl-devel
/usr/bin/pecl install pecl_http
將以下行添加到/etc/php.ini文件中:extension = http.so
重新啟動Apache服務器,以便加載擴展:
httpd -k restart
如果它不起作用,請告訴我輸出。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.