Php: extension ftp is failed to build (7.0.11)

Created on 21 Sep 2016  路  2Comments  路  Source: docker-library/php

It was successfully build by 7.0.8 version, and now when executing
$ docker-php-ext-install ftp

/usr/src/php/ext/ftp/php_ftp.c:33:26: fatal error: openssl/ssl.h: No such file or directory
# include

Most helpful comment

This is because you haven't installed the package which provides openssl/ssl.h, as noted in the image description (https://hub.docker.com/_/php/, under "PHP Core Extensions"; https://github.com/docker-library/docs/blob/63ece38734437704c7a48c335218f563615e5e09/php/README.md#php-core-extensions):

Remember, you must install dependencies for your extensions manually.

For example:

FROM php:7.0-alpine

RUN apk add --no-cache openssl-dev \
    && docker-php-ext-install ftp
FROM php:7.0

RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/* \
    && docker-php-ext-install ftp

(both tested successfully)

All 2 comments

This is because you haven't installed the package which provides openssl/ssl.h, as noted in the image description (https://hub.docker.com/_/php/, under "PHP Core Extensions"; https://github.com/docker-library/docs/blob/63ece38734437704c7a48c335218f563615e5e09/php/README.md#php-core-extensions):

Remember, you must install dependencies for your extensions manually.

For example:

FROM php:7.0-alpine

RUN apk add --no-cache openssl-dev \
    && docker-php-ext-install ftp
FROM php:7.0

RUN apt-get update && apt-get install -y libssl-dev && rm -rf /var/lib/apt/lists/* \
    && docker-php-ext-install ftp

(both tested successfully)

Thanks for explanation. I thought supported by docker-php-ext-install modules should get all requirements themselves, and this is a bug.

Was this page helpful?
0 / 5 - 0 ratings