没有可用于包的版本

时间:2014-05-09 11:30:03

标签: php pear ubuntu-14.04

我正在尝试在虚拟机的Ubuntu操作系统中安装一些gnupg等梨包,但如果我使用sudo pecl install gnupg,它会抛出

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

这不仅适用于gnupg,也适用于所有梨包。但我无法确定究竟是什么问题。相同的命令在我的另一个虚拟机中工作。所以我真的很困惑。请帮忙。

注意:

PEAR Version: 1.9.4
PHP Version: 5.5.9-1ubuntu4
Zend Engine Version: 2.5.0
Running on: Linux udhay-dev 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64

这是梨配置(使用pear config-show)显示的内容,

Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels     auto_discover    1
Default Channel                default_channel  pear.php.net
HTTP Proxy Server Address      http_proxy       http://foo.bar/
PEAR server [DEPRECATED]       master_server    pear.php.net
Default Channel Mirror         preferred_mirror pear.php.net
Remote Configuration File      remote_config    <not set>
PEAR executables directory     bin_dir          /home/udhay-dev/pear/bin
PEAR documentation directory   doc_dir          /home/udhay-dev/pear/docs
PHP extension directory        ext_dir          /usr/lib/php5/20121212+lfs
PEAR directory                 php_dir          /home/udhay-dev/pear/share/pear
PEAR Installer cache directory cache_dir        /tmp/pear/cache
PEAR configuration file        cfg_dir          /home/udhay-dev/pear/cfg
directory
PEAR data directory            data_dir         /home/udhay-dev/pear/data
PEAR Installer download        download_dir     /tmp/pear/install
directory
PHP CLI/CGI binary             php_bin          /usr/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/install
PEAR test directory            test_dir         /home/udhay-dev/pear/tests
PEAR www files directory       www_dir          /home/udhay-dev/pear/www
Cache TimeToLive               cache_ttl        3600
Preferred Package State        preferred_state  stable
Unix file mask                 umask            2
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       /etc/pear/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/udhay-dev/.pearrc
System Configuration File      Filename         /etc/pear/pear.conf

当我使用pear clear-cache时,显示

找不到目录/ tmp / pear / cache。

对于命令pear update-channelspear upgrade,我得到了

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/http.so' - /usr/lib/php5/20121212/http.so: undefined symbol: php_persistent_handle_abandon in Unknown on line 0
Updating channel "doc.php.net"
Channel "doc.php.net" is not responding over http://, failed with message: Connection to `foo.bar:8080' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
Trying channel "doc.php.net" over https:// instead
Cannot retrieve channel.xml for channel "doc.php.net" (Connection to `foo.bar:8080' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known)
Updating channel "pear.php.net"
Channel "pear.php.net" is not responding over http://, failed with message: Connection to `foo.bar:8080' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
Trying channel "pear.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pear.php.net" (Connection to `foo.bar:8080' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known)
Updating channel "pecl.php.net"
Channel "pecl.php.net" is not responding over http://, failed with message: Connection to `foo.bar:8080' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known
Trying channel "pecl.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pecl.php.net" (Connection to `foo.bar:8080' failed: php_network_getaddresses: getaddrinfo failed: Name or service not known)

4 个答案:

答案 0 :(得分:10)

你之前尝试过这个吗?

pear clear-cache
pear update-channels
pear upgrade

答案 1 :(得分:6)

我有pecl和oci8这个问题。通过将代理设置为通过我们的防火墙解决:

sudo pear config-set http_proxy http://username:password@proxy.domain:port

也许这是你的问题?

答案 2 :(得分:1)

似乎任何连接问题都可能导致pear install返回&#34;没有可用的版本&#34;。其他梨命令如pear list-upgradespear update-channels会返回更多有用的错误。

当OP运行pear update-channels时,他们得到了#34; php_network_getaddresses:getaddrinfo失败:名称或服务未知&#34;错误。所以我的猜测是OP在他们的VM上有某种DNS配置问题。

在我们自己的情况下,我们的Linux服务器是AWS EC2实例。当我们运行pear list-upgrades时,我们看到&#34;连接已超时&#34;消息。所以我们的问题是我们的AWS安全组阻止了出站HTTP流量。

答案 3 :(得分:0)

在我的情况下,我使用了pecl二进制而不是pear二进制文件,它帮助安装了包并摆脱了No releases available...错误。

我知道OP使用pecl但是我在使用php_pear资源的厨师中遇到完全相同的错误之后来到这里,所以我会留在这里以防有人像我一样找到这个页面。