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

curl extension fails to install on php:7.3.12-fpm-stretch #922

Closed
jelovac opened this issue Dec 9, 2019 · 5 comments
Closed

curl extension fails to install on php:7.3.12-fpm-stretch #922

jelovac opened this issue Dec 9, 2019 · 5 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@jelovac
Copy link

jelovac commented Dec 9, 2019

Hi,

I wanted to upgrade the base image from php:7.3.9-fpm-stretch to php:7.3.12-fpm-stretch however the docker build fails with the following error message:

Configuring for:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
configure: error: unrecognized options: --with-openssl

The Dockerfile example:

FROM php:7.3.12-fpm-stretch

# Install necessary packages
RUN \
	apt-get update \
	&& apt-get install -y \
		build-essential \
		cron \
		git \
		locales \
		openssl \
		pkg-config \
		unzip

# Install PHP extensions which depend on external libraries
RUN \
    apt-get update \
    && echo 'Installing PHP curl extension' \
    && apt-get install -y --no-install-recommends libssl-dev libcurl4-openssl-dev \
    && docker-php-ext-configure curl --with-curl --with-openssl=/usr \
    && docker-php-ext-install -j$(nproc) curl

Remarks:

  • changed only the FROM part, everything else in the Dockerfile is the same between the new and old version
  • tested the build again with old version, builds successfully without issues
  • tried to replace --with-openssl flag to --with-openssl-dir =>same error type
@JoelLinn
Copy link

JoelLinn commented Dec 9, 2019

First of all:

configure: error: unrecognized options: --with-openssl

says it all. That option just needs to be omitted.

Then, isn't curl included by default? At least on buster cli it is. That would render all of your Dockerfile obsolete.

@yosifkit
Copy link
Member

yosifkit commented Dec 9, 2019

Yeah the images have been building php --with-curl since 2014 (#27).

The configure: error: unrecognized options you are getting was a result of #918. (sorry for breaking that, but we thought it was important especially with the changes in 7.4 like mentioned here)

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Dec 10, 2019
@jelovac
Copy link
Author

jelovac commented Dec 10, 2019

Thank you guys for clarifying this.

Do you have a list of php-extensions which come witch the images by default or do we need to check from the running container?

@yosifkit
Copy link
Member

No concrete list, since it can change from version to version (php upstream changes or changes here). We do try to minimize our changes and only include modules that are required or difficult/impossible to use as an external module.

So yes, you need to check that the version you are using has the module included (docker-library/docs#1567):

Default extensions

Some extensions are compiled by default. This depends on the PHP version you are using. Run php -m in the container to get a list for your specific version.

Maybe something like a php -m | grep 'full-module-name' in a Dockerfile RUN line should make sure that the module you expect is there when building your image.

@jelovac
Copy link
Author

jelovac commented Dec 11, 2019

Ok, thanks for additional info.

I will close the issue.

Best regards,
Vladimir

@jelovac jelovac closed this as completed Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

4 participants