Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
916 views
in Technique[技术] by (71.8m points)

How to enable Memcache in php:5.6-fpm-alpine docker container

This is error output on php -m

Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so'

  • Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20131226/memcache.so: No such file or directory in Unknown on line 0

Dockerfile

ARG PHP_VERSION=5.6

FROM php:${PHP_VERSION}-fpm-alpine

RUN apk --update add openssh-client make grep autoconf gcc libc-dev zlib-dev

RUN cd /tmp 
    && curl -o php-memcache.tgz http://pecl.php.net/get/memcache-3.0.8.tgz 
    && tar -xzvf php-memcache.tgz 
    && cd memcache-3.0.8 
    && curl -o memcache-faulty-inline.patch http://git.alpinelinux.org/cgit/aports/plain/main/php5-memcache/memcache-faulty-inline.patch?h=3.4-stable 
    && patch -p1 -i memcache-faulty-inline.patch 
    && phpize 
    && ./configure --prefix=/usr 
    && make INSTALL_ROOT=/ install 
    && install -d ./etc/php/conf.d 
    && echo "extension=memcache.so" > /usr/local/etc/php/conf.d/docker-php-ext-memcache.ini

docker-compose up -d has no error on execution, the extension is enabled but still missing from the system.

NOTE: This is a legacy system working on PHP 5.6 that needs to be dockerized in order to refactor the project to work on PHP 7.x

Project are dependant on Memcache and not on Memcached

question from:https://stackoverflow.com/questions/65869597/how-to-enable-memcache-in-php5-6-fpm-alpine-docker-container

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...