2

I have a custom PHP module that depends on an external library that is not thread safe. Does FPM use threads or processes to handle requests? Is it safe to use a non-threadsafe php module with PHP-FPM?

Joyce Babu
  • 19,602
  • 13
  • 62
  • 97
  • Maybe this will help you with this question: http://stackoverflow.com/questions/1623914/what-is-thread-safe-or-non-thread-safe-in-php?lq=1 – node_modules Mar 29 '16 at 08:33
  • Thank you @C0dekid.php. The answers in the linked question are about php-fcgi and mod_php. I am interested in PHP-FPM. I want to know if the process pool in FPM uses threads. – Joyce Babu Mar 29 '16 at 08:37

1 Answers1

4

I asked this question in a PHP IRC channel and was told that PHP-FPM is always non-threaded, as it makes no sense to build it as thread safe. Since each request is handled by a separate process (which is re-used) in PHP-FPM, it should be safe to use the module with PHP-FPM.

Joyce Babu
  • 19,602
  • 13
  • 62
  • 97