Skip to content
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 · 20 comments
Closed

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

yeszao opened this issue Dec 5, 2017 · 20 comments

Comments

@yeszao
Copy link
Owner

@yeszao 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
Copy link
Owner Author

@yeszao 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
Copy link
Owner Author

@yeszao yeszao commented Dec 14, 2017

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

@zhoutengfu
Copy link

@zhoutengfu zhoutengfu commented Jan 3, 2018

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

@yeszao
Copy link
Owner Author

@yeszao yeszao commented Jan 26, 2018

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

This was referenced Mar 6, 2018
@Dshufeng
Copy link

@Dshufeng Dshufeng commented Mar 29, 2018

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

@liuqingliu
Copy link

@liuqingliu liuqingliu commented Apr 10, 2018

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

@cymsummer
Copy link

@cymsummer cymsummer commented Apr 10, 2018

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

@larlencee
Copy link

@larlencee larlencee commented Apr 10, 2018

@liuqingliu 我删了 也可以用了

@yeszao yeszao closed this Apr 11, 2018
@chendongdongdd01
Copy link

@chendongdongdd01 chendongdongdd01 commented Apr 11, 2018

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

@chendongdongdd01
Copy link

@chendongdongdd01 chendongdongdd01 commented Apr 11, 2018

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

@yeszao
Copy link
Owner Author

@yeszao yeszao commented Apr 11, 2018

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

@liuqingliu
Copy link

@liuqingliu liuqingliu commented Apr 12, 2018

@yeszao 谢谢大佬。很厉害!

@MRchenao
Copy link

@MRchenao 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
Copy link
Owner Author

@yeszao yeszao commented Apr 16, 2018

@MRchenao 👍

@i-cooltea
Copy link

@i-cooltea i-cooltea 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 \
@haydenzhourepo
Copy link

@haydenzhourepo haydenzhourepo commented Nov 6, 2018

@ADirtyCat why docker-php-ext-enable not found

@i-cooltea
Copy link

@i-cooltea i-cooltea commented Nov 6, 2018

@haydenzhourepo
看你的基础容器是什么
FROM php:7.1-fpm

@ADirtyCat why docker-php-ext-enable not found

@yeszao
Copy link
Owner Author

@yeszao yeszao commented Nov 7, 2018

@MRchenao @ADirtyCat 总结得很好

唯一担心的就是,我的网络经常 pecl.php.net 都得用梯子,无语啊~~我猜不少人也是一样的情况。
所以要分两种情况,网络顺畅的时候,用 curl/wget
要是网络不好,就用现成的包

@wonbin2011
Copy link

@wonbin2011 wonbin2011 commented Jan 1, 2019

加上代理好使了,建议楼主以后发dockerfile 尽量把自己的配置信息去掉。没有坑到我 ,我都是用官方的

@yeszao
Copy link
Owner Author

@yeszao yeszao commented Jan 7, 2019

@wonbin2011 早已经没有咯~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.