New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

错误: No releases available for package "pecl.php.net/redis"解决 #10

Closed
yeszao opened this Issue Dec 5, 2017 · 15 comments

Comments

Projects
None yet
9 participants
@yeszao
Owner

yeszao commented Dec 5, 2017

pecl -vvv install redis-3.1.4

`Warning: file_exists(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1511

Warning: is_file(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1521

Warning: is_file(): Unable to find the wrapper "channel" - did you forget to enable it when you configured PHP? in PEAR/Downloader/Package.php on line 1521

Warning: fsockopen(): Failed to enable crypto in PEAR/Proxy.php on line 179

Warning: fsockopen(): unable to connect to ssl://pecl.php.net:443 (Unknown error) in PEAR/Proxy.php on line 179
No releases available for package "pecl.php.net/redis"
Cannot initialize 'channel://pecl.php.net/redis-3.1.4', invalid or missing package file
Package "channel://pecl.php.net/redis-3.1.4" is not valid
install failed`

@yeszao

This comment has been minimized.

Show comment
Hide comment
@yeszao

yeszao Dec 5, 2017

Owner

这个错误主要是因为国网络访问外网受限所致。
解决的方法是,
在用pecl install之前,给pear加上proxy,Dockerfile中:

RUN pear config-set http_proxy http://10.0.75.1:1080

注意,其中的IP要换成可用的proxy IP。
按说,用pecl config-set也可以,不过试了没有成功,用pear可以。

Owner

yeszao commented Dec 5, 2017

这个错误主要是因为国网络访问外网受限所致。
解决的方法是,
在用pecl install之前,给pear加上proxy,Dockerfile中:

RUN pear config-set http_proxy http://10.0.75.1:1080

注意,其中的IP要换成可用的proxy IP。
按说,用pecl config-set也可以,不过试了没有成功,用pear可以。

@yeszao

This comment has been minimized.

Show comment
Hide comment
@yeszao

yeszao Dec 14, 2017

Owner

如果没有代理的话,可以从pecl.php.net下载源码包,然后参考/php/php54/Dockerfile文件的最后7行,通过源码包方式安装。

Owner

yeszao commented Dec 14, 2017

如果没有代理的话,可以从pecl.php.net下载源码包,然后参考/php/php54/Dockerfile文件的最后7行,通过源码包方式安装。

@zhoutengfu

This comment has been minimized.

Show comment
Hide comment
@zhoutengfu

zhoutengfu commented Jan 3, 2018

我是在自己的mac上安装的,RUN pear config-set http_proxy http://192.168.2.81(主机IP),mac上是开了代理服务器的,我是哪里配置错了吗

@yeszao

This comment has been minimized.

Show comment
Hide comment
@yeszao

yeszao Jan 26, 2018

Owner

可以ping通主机的IP吗?如果ping不通,用docker虚拟出来的IP,比如示例中的:10.0.75.1

Owner

yeszao commented Jan 26, 2018

可以ping通主机的IP吗?如果ping不通,用docker虚拟出来的IP,比如示例中的:10.0.75.1

This was referenced Mar 6, 2018

@Dshufeng

This comment has been minimized.

Show comment
Hide comment
@Dshufeng

Dshufeng Mar 29, 2018

关于有墙的问题.其实更简单的方法是利用好dockerhub的自动构建功能,相当于做了下中转.

Dshufeng commented Mar 29, 2018

关于有墙的问题.其实更简单的方法是利用好dockerhub的自动构建功能,相当于做了下中转.

@liuqingliu

This comment has been minimized.

Show comment
Hide comment
@liuqingliu

liuqingliu Apr 10, 2018

老板,您故意的吧。我直接把您这句“RUN pear config-set http_proxy http://10.0.75.1:1080” 给删了。就可以了。。。害得我好辛苦。。。

liuqingliu commented Apr 10, 2018

老板,您故意的吧。我直接把您这句“RUN pear config-set http_proxy http://10.0.75.1:1080” 给删了。就可以了。。。害得我好辛苦。。。

@cymsummer

This comment has been minimized.

Show comment
Hide comment
@cymsummer

cymsummer Apr 10, 2018

感谢楼上的评论,拯救了我!

cymsummer commented Apr 10, 2018

感谢楼上的评论,拯救了我!

@larlencee

This comment has been minimized.

Show comment
Hide comment
@larlencee

larlencee Apr 10, 2018

@liuqingliu 我删了 也可以用了

larlencee commented Apr 10, 2018

@liuqingliu 我删了 也可以用了

@yeszao yeszao closed this Apr 11, 2018

@chendongdongdd01

This comment has been minimized.

Show comment
Hide comment
@chendongdongdd01

chendongdongdd01 Apr 11, 2018

@larlence100 可以告诉我是在哪个文件里面有这个吗,具体的路径,为啥我都找不到这个

chendongdongdd01 commented Apr 11, 2018

@larlence100 可以告诉我是在哪个文件里面有这个吗,具体的路径,为啥我都找不到这个

@chendongdongdd01

This comment has been minimized.

Show comment
Hide comment
@chendongdongdd01

chendongdongdd01 Apr 11, 2018

@liuqingliu 知道了,被博主删除了,再拉一次master分支就行了

chendongdongdd01 commented Apr 11, 2018

@liuqingliu 知道了,被博主删除了,再拉一次master分支就行了

@yeszao

This comment has been minimized.

Show comment
Hide comment
@yeszao

yeszao Apr 11, 2018

Owner

@liuqingliu @larlence100 @cymsummer 加了php72后没删掉,抱歉~已经修正

Owner

yeszao commented Apr 11, 2018

@liuqingliu @larlence100 @cymsummer 加了php72后没删掉,抱歉~已经修正

@liuqingliu

This comment has been minimized.

Show comment
Hide comment
@liuqingliu

liuqingliu Apr 12, 2018

@yeszao 谢谢大佬。很厉害!

liuqingliu commented Apr 12, 2018

@yeszao 谢谢大佬。很厉害!

@MRchenao

This comment has been minimized.

Show comment
Hide comment
@MRchenao

MRchenao Apr 14, 2018

楼主的这个安装了好久,跟大家出现一样的错误,但是又很不想使用楼主说的7行代码那么长的源码安装方式。也没有代理。所以改成了如下方式,成功了。记录一下分享给大家。

RUN sudo apt-get install php-dev php-pear autoconf automake libtool -y

COPY ./redis-3.1.5.tgz /var/www/html/
RUN curl 'http://pecl.php.net/get/xdebug-2.6.0alpha1.tgz' -o /var/www/html/xdebug-2.6.0alpha1.tgz

RUN pecl install redis-3.1.5.tgz
&& rm -rf redis-3.1.5.tgz
&& docker-php-ext-enable redis
&& :
&& pecl install xdebug-2.6.0alpha1.tgz
&& rm -rf xdebug-2.6.0alpha1.tgz
&& docker-php-ext-enable xdebug \

这里有两种方式 一种是redis的先在容器外面的下载安装包,然后拷贝到容器中。这个方法比较麻烦。另一种就是像xdebug这种的,在容器中直接下载,然后安装。两种都可以,供大家参考

MRchenao commented Apr 14, 2018

楼主的这个安装了好久,跟大家出现一样的错误,但是又很不想使用楼主说的7行代码那么长的源码安装方式。也没有代理。所以改成了如下方式,成功了。记录一下分享给大家。

RUN sudo apt-get install php-dev php-pear autoconf automake libtool -y

COPY ./redis-3.1.5.tgz /var/www/html/
RUN curl 'http://pecl.php.net/get/xdebug-2.6.0alpha1.tgz' -o /var/www/html/xdebug-2.6.0alpha1.tgz

RUN pecl install redis-3.1.5.tgz
&& rm -rf redis-3.1.5.tgz
&& docker-php-ext-enable redis
&& :
&& pecl install xdebug-2.6.0alpha1.tgz
&& rm -rf xdebug-2.6.0alpha1.tgz
&& docker-php-ext-enable xdebug \

这里有两种方式 一种是redis的先在容器外面的下载安装包,然后拷贝到容器中。这个方法比较麻烦。另一种就是像xdebug这种的,在容器中直接下载,然后安装。两种都可以,供大家参考

@yeszao

This comment has been minimized.

Show comment
Hide comment
@yeszao
Owner

yeszao commented Apr 16, 2018

@MRchenao 👍

@ADirtyCat

This comment has been minimized.

Show comment
Hide comment
@ADirtyCat

ADirtyCat Jul 20, 2018

使用楼上那位兄弟@MRchenao 的说法
docker 容器中下载后再安装

完整代码整理 如下

RUN \
# ----- redis -----
curl 'http://pecl.php.net/get/redis-3.1.5.tgz' -o /tmp/redis-3.1.5.tgz  \
&& cd /tmp \
&& pecl install redis-3.1.5.tgz \
&& rm -rf redis-3.1.5.tgz \
&& docker-php-ext-enable redis \


# ----- xdebug -----
&& :\
&& curl 'http://pecl.php.net/get/xdebug-2.6.0alpha1.tgz' -o /tmp/xdebug-2.6.0alpha1.tgz  \
&& cd /tmp \
&& pecl install xdebug-2.6.0alpha1.tgz \
&& rm -rf xdebug-2.6.0alpha1.tgz \
&& docker-php-ext-enable xdebug \


# ----- imagick -----
&& :\
&& apt-get install -y libmagickwand-dev \
&& curl 'http://pecl.php.net/get/imagick-3.4.3.tgz' -o /tmp/imagick-3.4.3.tgz  \
&& cd /tmp \
&& pecl install imagick-3.4.3.tgz \
&& rm -rf imagick-3.4.3.tgz \
&& docker-php-ext-enable imagick \


# ----- memcached -----
&& :\
&& apt-get install -y libmemcached-dev zlib1g-dev \
&& curl 'http://pecl.php.net/get/memcached-2.2.0.tgz' -o /tmp/memcached-2.2.0.tgz  \
&& cd /tmp \
&& pecl install memcached-2.2.0.tgz \
&& rm -rf memcached-2.2.0.tgz \
&& docker-php-ext-enable memcached \

ADirtyCat commented Jul 20, 2018

使用楼上那位兄弟@MRchenao 的说法
docker 容器中下载后再安装

完整代码整理 如下

RUN \
# ----- redis -----
curl 'http://pecl.php.net/get/redis-3.1.5.tgz' -o /tmp/redis-3.1.5.tgz  \
&& cd /tmp \
&& pecl install redis-3.1.5.tgz \
&& rm -rf redis-3.1.5.tgz \
&& docker-php-ext-enable redis \


# ----- xdebug -----
&& :\
&& curl 'http://pecl.php.net/get/xdebug-2.6.0alpha1.tgz' -o /tmp/xdebug-2.6.0alpha1.tgz  \
&& cd /tmp \
&& pecl install xdebug-2.6.0alpha1.tgz \
&& rm -rf xdebug-2.6.0alpha1.tgz \
&& docker-php-ext-enable xdebug \


# ----- imagick -----
&& :\
&& apt-get install -y libmagickwand-dev \
&& curl 'http://pecl.php.net/get/imagick-3.4.3.tgz' -o /tmp/imagick-3.4.3.tgz  \
&& cd /tmp \
&& pecl install imagick-3.4.3.tgz \
&& rm -rf imagick-3.4.3.tgz \
&& docker-php-ext-enable imagick \


# ----- memcached -----
&& :\
&& apt-get install -y libmemcached-dev zlib1g-dev \
&& curl 'http://pecl.php.net/get/memcached-2.2.0.tgz' -o /tmp/memcached-2.2.0.tgz  \
&& cd /tmp \
&& pecl install memcached-2.2.0.tgz \
&& rm -rf memcached-2.2.0.tgz \
&& docker-php-ext-enable memcached \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment