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

Can't install an external lib #262

Closed
fprezat opened this issue Jul 15, 2016 · 9 comments
Closed

Can't install an external lib #262

fprezat opened this issue Jul 15, 2016 · 9 comments

Comments

@fprezat
Copy link

fprezat commented Jul 15, 2016

Hello,
I try to install an external lib using php:5.6-apache image.
I use this in my dockerfile to install phpredis lib

RUN curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/3.0.0.tar.gz \
    && tar xfz /tmp/redis.tar.gz \
    && rm -r /tmp/redis.tar.gz \
    && mv phpredis-3.0.0 /usr/src/php/ext/redis \
    && docker-php-ext-install redis

But i get this error :

mv: cannot move 'phpredis-3.0.0' to '/usr/src/php/ext/redis': No such file or directory

Can you please help me on this
Thx :)

@mitchhh22
Copy link

Same issue here with php:5.5-apache

Noticed it yesterday.
Seems that 'redis' is missing from php-available-exts... If I add it manually docker-php-ext-install redis works.

@shouze
Copy link
Contributor

shouze commented Jul 16, 2016

@fprezat ok so what you need to do is more something like:

RUN docker-php-source extract \
    && curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/3.0.0.tar.gz \
    && tar xfz /tmp/redis.tar.gz \
    && rm -r /tmp/redis.tar.gz \
    && mv phpredis-3.0.0 /usr/src/php/ext/redis \
    && docker-php-ext-install redis

@airycanon
Copy link

This is what I did:

RUN docker-php-source extract \
    && curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/2.2.8.tar.gz \
    && tar xfz /tmp/redis.tar.gz \
    && rm -r /tmp/redis.tar.gz \
    && mv phpredis-2.2.8 /usr/src/php/ext/redis \
    && sed -i '$ a redis' /usr/src/php-available-exts \
    && docker-php-ext-install redis \
    && docker-php-source delete

By the way,3.0.0 is only for php7,you need 2.2.8. phpredis/phpredis#884

@fprezat
Copy link
Author

fprezat commented Jul 18, 2016

Hello
@shouze Your solution works great :)
@airycanon ok thx for the warning, i will use 2.2.8
@mitchhh22 thx for the help

@shouze
Copy link
Contributor

shouze commented Jul 18, 2016

@fprezat so maybe you can close this issue then?
It's mainly because of #256 which reduce the docker image size so the benefits worth the tiny needed changes for the installation of some custom/not bundled within php extensions.

@derimagia
Copy link

derimagia commented Aug 21, 2016

You can still use pecl for this, but the important thing is to extract/delete the source.

RUN docker-php-source extract && \
    pecl install xdebug redis && \
    docker-php-ext-enable xdebug redis && \
    docker-php-source delete

@shadiakiki1986
Copy link

shadiakiki1986 commented Sep 6, 2016

Using the php:7-apache image, I downloaded from github (listed many times above) into /usr/src/php/ext/redis, except that I used the php7 branch, i.e. https://github.com/phpredis/phpredis/archive/php7.zip, instead of specifying 3.0.0 as @airycanon commented

@cice
Copy link

cice commented Jul 25, 2017

today building my image failed with /usr/src/php/ext no such file or directory (following shouze's suggestion). last time i had to rebuild, it worked flawlessly. i guess there were some changes in the fpm base image, and adding 'mkdir -p /usr/src/php/ext' fixed that for me. just in case somebody runs into the same problem.

@niloofarfs
Copy link

niloofarfs commented Aug 24, 2017

@airycanon I get this error: mv: cannot move 'phpredis-2.2.7' to '/usr/src/php/ext/redis': No such file or directory I'm using FROM php:5.6-fpm. I tried mkdir -p /usr/src/php/ext/redis \ but obviously fails again:
Cannot find config.m4. Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

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

No branches or pull requests

8 participants