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

Request for php-fpm-zts #249

Closed
SmoshySmosh opened this issue Jul 3, 2016 · 13 comments
Closed

Request for php-fpm-zts #249

SmoshySmosh opened this issue Jul 3, 2016 · 13 comments

Comments

@SmoshySmosh
Copy link

What are the chances of getting an official php-fpm-zts container for those of us who want to use pthreads with php-fpm + nginx?

I could always go build my own, but I like to use official containers wherever possible. Thoughts?

Thank you,
Ethan

@SmoshySmosh
Copy link
Author

After creating my own image, I realized that this does not make much sense.

Closing.

@MelwinKfr
Copy link

Hi SmoshySmosh, I'm in the exact same place. Why does it not makes sense to have a php-fpm-zts container ?

@SmoshySmosh
Copy link
Author

@MelwinKfr I was wanting to use pthreads through php-fpm but once I built my own container to do so, I realized that pthreads only works in CLI mode which was not the context that I needed it in.

SAPI Support

pthreads v3 is restricted to operating in CLI only: I have spent many years trying to explain that threads in a web server just don't make sense, after 1,111 commits to pthreads I have realised that, my advice is going unheeded.

So I'm promoting the advice to hard and fast fact: you can't use pthreads safely and sensibly anywhere but CLI.

Thanks for listening ;)

@tianon
Copy link
Member

tianon commented Nov 1, 2016

@MelwinKfr
Copy link

Okay I see, thank you for the hints !

@j4r3kb
Copy link

j4r3kb commented Mar 25, 2018

How about a case where you run Symfony app on a php-fpm container and want to use threads for Symfony commands which run in CLI?
php-fpm-zts container would be useful for this.

@rvdlee-salesupply
Copy link

I'd like an renewed look at this from the php team. @j4r3kb seems to have the same usecase as us in mind. We are currently building an Zend application with the same situation. We also have CLI command that want to utilize the ZTS version.

@SmoshySmosh
Copy link
Author

@rvdlee-salesupply

I know my version is quite a bit old, but you can test your theories against my php-fpm-zts container if you'd like. I can't find my original Dockerfile at the moment, but I will look for it more tomorrow and see if I can provide that for you too.

https://hub.docker.com/r/smoshysmosh/php-fpm-zts

@rvdlee-salesupply
Copy link

rvdlee-salesupply commented Dec 11, 2018

@SmoshySmosh I've done something alike already. It would be nice if you could drum up your dockerfile :) It wasn't difficult to get NTS and ZTS running next to each other. The nice thing about the official php images is that they are a solid foundation to work from to make whatever image you need. I've standardized the process to create our production images.

Getting the exact same versions to run along each other proves to be a challenge. Alpine repositories in Edge only seem to support the last two versions. This proves to be a problem when you want to start with version pinning; which APK supports apk add php=7.2.11-r0 for example. Two months from now the repositories will have been updated with new versions. This would be a hassle in the sense that whenever I want to deploy a new ZTS+(NTS+FPM) image, the versions between the official php docker hub and alpine repositories should match if you want to go down the official repository route.

My next venture is going to be building from source. Here you have the freedom to download from the php archives. However, it is important to me that the build args are as much the same as possible. Packages included like gettext, intl, zip and whatever is necessary.

Yet, this is exactly what makes the official images so nice. The solid standard php executable build from source. That's why It would be nice to have this in the official php docker hub.

We run a setup where we have a private repository where we store all our production images. The nice thing now is that everything is version pinned. This way we have exact control over images.

@italodeveloper
Copy link

Hello friends, I'm also going through the same situation and I noticed that the discourse is active, I'm setting up a dockerfile for php7.2-fpm-zts, if anyone already has it, it would save me a lot of time.

@rvdlee-salesupply
Copy link

rvdlee-salesupply commented Dec 12, 2018

@italodeveloper I'm not at liberty to openly share the whole image. What I can do though is help you get started with my experience on this so far.

I've based my ZTS image on top of the FPM image. FPM by default ships with the normal NTS version. Then, using the PHP_URL and PHP_ASC_URL which is already set, I download the source from the archives. I use php-config --configure-options to get the original build options as by the FPM image. I sed the following options out: --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data replace the config path to a seperate one I want to be able to configure ZTS completly seperate and add --enable-maintainer-zts, move the NTS binary out of the way RUN mv /usr/local/bin/php /usr/local/bin/php-nts. Start building, after building install move the ZTS version elsewhere and NTS installing back in place. When I've rafactored the whole code a tad -- because it is a real mess now I will post back a snippet here.

@okdewit
Copy link

okdewit commented Jul 2, 2019

I think there is another use case: The PHP 7.2 Parallel API. To me it seems it's made for web requests, but it does require ZTS to be enabled.

@vladxendev
Copy link

@rvdlee-salesupply

I know my version is quite a bit old, but you can test your theories against my php-fpm-zts container if you'd like. I can't find my original Dockerfile at the moment, but I will look for it more tomorrow and see if I can provide that for you too.

https://hub.docker.com/r/smoshysmosh/php-fpm-zts

This php build not supported architecture ARM, i'm use this build from my Docker file and docker printed errors on standart_linux_go:221.
My arch: arm64v8/aarch64-linux-gnu

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

8 participants