19

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?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164

1 Answers1

29

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
  • 9,082
  • 15
  • 74
  • 164
Nigel Ren
  • 56,122
  • 11
  • 43
  • 55
  • 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
  • 2
    I 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