As I was looking on: https://hub.docker.com/_/php/ I have seen images tagged as: version_number-zts or version_number-zts-alpine and I am wondering what does the zts indicate on these tags and how much different are from fpm or Apache images?
Asked
Active
Viewed 9,987 times
14
James Graham
- 39,063
- 41
- 167
- 242
Dimitrios Desyllas
- 7,732
- 8
- 58
- 129
-
Enables zts (Zend Thread Safety) package in PHP - http://php.net/manual/en/pthreads.requirements.php – Nigel Ren Oct 01 '17 at 13:46
1 Answers
21
If you read one of the docker files https://github.com/docker-library/php/blob/1e6f8ba4901a5f3f02f447fd70d4226193e4f24b/7.2-rc/zts/Dockerfile for example. This has
ENV PHP_EXTRA_CONFIGURE_ARGS --enable-maintainer-zts
This is used to enable the Zend Thread Safety package in PHP which is used for pthreads. From the PHP manual(http://php.net/manual/en/pthreads.requirements.php)
pthreads requires a build of PHP with ZTS (Zend Thread Safety) enabled ( --enable-maintainer-zts or --enable-zts on Windows )
Regarding the zts itself is something related to pthreads where you can look for more information on Php: when to use pthread
Dimitrios Desyllas
- 7,732
- 8
- 58
- 129
Nigel Ren
- 53,991
- 11
- 38
- 52
-
And how usefull is zend thread safety. I mean which cases may seem usefull to use zts what is different with zts? – Dimitrios Desyllas Oct 01 '17 at 13:55
-
2I think the main thing is that it's a core part of being able to use pthreads, this is the ability to multi-thread PHP. Normally you have a request which is dealt with by a single thread, multi threading may allow you to spread the processing across multiple processes. https://stackoverflow.com/questions/14126696/php-when-to-use-pthread may give more ideas. – Nigel Ren Oct 01 '17 at 13:58