Comment installer une extension pour php via docker-php-ext-installer?
Pour résoudre un problème, je suis en train d'essayer d'installer la base de données mysql via pdo
docker-php-ext-install
comme souligné dans le Fichier lisez-moi de l'php image.
Encore mon échec de l'appel en déclarant:
Libraries have been installed in:
/usr/src/php/ext/mysqli/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
Installing header files: /usr/local/include/php/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
+ cd /usr/src/php/ext/mysqlnd
+ phpize
Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
ERROR: Service 'phlaconapp' failed to build: The command '/bin/sh -c docker-php-ext-install mysqli mysqlnd pdo pdo_mysql zip' returned a non-zero code: 1
C'est mon docker-compose.yml
:
phlaconapp:
hostname: phaclonapp
dockerfile: Dockerfile
build: ./
ports:
- "1080:80"
- "1043:433"
environment:
TERM: xterm-color
ENVIRONMENT: dev
volumes:
- ./:/var/www/html/
links:
- mysql
mysql:
image: mysql:5.6
volumes:
- ./docker/mysql.d:/etc/mysql/conf.d
ports: ["3306:3306"]
environment:
MYSQL_ROOT_PASSWORD: 'root'
C'est mon Dockerfile
:
FROM php:5.6-apache
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('SHA384', 'composer-setup.php') === '070854512ef404f16bac87071a6db9fd9721da1684cd4589b1196c3faf71b9a2682e2311b36a5079825e155ac7ce150d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php && \
php -r "unlink('composer-setup.php');"
RUN apt-get update && \
apt-get install vim git -y
RUN docker-php-ext-install mysqli mysqlnd pdo pdo_mysql zip
RUN cd / && \
git clone --depth=1 git://github.com/phalcon/cphalcon.git && \
cd cphalcon/build && \
./install
RUN echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/phalcon.ini
RUN a2enmod rewrite
et en cours d'exécution docker-compose build
n'arrive pas à terminer.
Suivi sur github.com/docker-library/php/issues/233 créée
OriginalL'auteur k0pernikus | 2016-05-30
Vous devez vous connecter pour publier un commentaire.
J'ai eu le même problème une volonté d'années. J'ai commencé un récipient et tapé le ext-installer les commandes dans ce conteneur. Une fois j'ai trouvé toutes les dépendances que j'ai écrit dans le dockerfile.
Exmample:
Il y a un dependencie que libmcrypt-dev est nécessaire avant que vous pouvez docker-php-ext-installer mcrypt
J'ai vérifié mes anciennes Dockerfiles et trouvé quelque chose qui pourrait vous aider à
le Paramètre-y est différente dans votre config pour le mien. apt-get install -y au lieu de apt-get install vim git -y
OriginalL'auteur Florian
Semble être un bug dans
phpize
(https://bugs.php.net/bug.php?id=53571).J'ai ajouté ce qui suit à
docker-php-ext-configure
:OriginalL'auteur Enrico Stahn
Que le code peut faire installer toute l'extension que vous souhaitez dans ce cas, mysql pdp pilote, mais le Dockerfile devrait avoir la base de
FROM php:7.1.8-apache
OriginalL'auteur beastar 457