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

Is there an easy way to recompile php with extra ./configure options. #111

Closed
WillSkates opened this issue Jun 30, 2015 · 5 comments
Closed

Comments

@WillSkates
Copy link

Is there an easy way of adding the option to compile with the --enable-maintainer-zts option or should I create an alternative image for this?

Sorry if i'm being blind and it's already there.

@yosifkit
Copy link
Member

Since this is not the default or upstream recommended option and would affect the users of the image, I think the easiest would be to fork the Dockerfile and build it for your needs.

@janpapenbrock
Copy link

Same question here, I want to configure with --enable-sockets.

$PHP_EXTRA_CONFIGURE_ARGS appears to be there for exactly this purpose, however I can't get it to work... how can I do it?

Edit/Update: I see now that it is explicitly set within the Dockerfile:

ENV PHP_EXTRA_CONFIGURE_ARGS --with-apxs2

Still cannot modify it from outside though...

Edit/Update 2: Ah, my bad, apparently ENV only works on run, not on build.

@md5
Copy link
Contributor

md5 commented Sep 12, 2015

@janpapenbrock ENV works during build too, but I suppose it depends on what you're trying to do.

In the case of the sockets module, I believe it can just be added in a derived image with docker-php-ext-install.

See this gist, which uses an example from the PHP sockets documentation (slightly modified to hit www.google.com instead of www.example.com): https://gist.github.com/md5/f0ca3ba1c2b0f04785fb

You can build and test it like so:

$ git clone https://gist.github.com/f0ca3ba1c2b0f04785fb.git php-sockets-test
$ docker build -t php-sockets-test php-sockets-test
$ docker run --rm php-sockets-test

This doesn't work in the case of some modules or for special flags like --enable-maintainer-zts, but it does work for --enable-sockets and most other "normal" modules.

@janpapenbrock
Copy link

I would swear it didn't work when I tested RUN docker-php-ext-install sockets yesterday (with php:5.6-apache), but today, it works flawlessly.

So thanks for your help! And sorry for hijacking this issue...

@tianon
Copy link
Member

tianon commented Aug 22, 2016

FTR, we merged some official ZTS variants in #171. 👍

@tianon tianon closed this as completed Aug 22, 2016
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

5 participants