Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

  • Is PHP (as of 5.2) thread-safe on Linux/UNIX?
  • Would it be possible to use it with Apache Worker-MPM or Event-MPM?

The facts I gathered so far are inconclusive:

  • Default binaries included in most distributions have ZTS disabled, so I'm aware, that I'd have to recompile them.
  • In theory Zend Engine (core PHP) with ZTS enabled is thread-safe.
  • It's said that some modules might not be thread-safe, but I haven't found any list of modules that are or that are not.
  • PHP FAQ states pretty much same as above.

What's your experience?

It's not only about segmentation faults ("access violations" in Windows nomenclature). There is a lot more to thread safety.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
661 views
Welcome To Ask or Share your Answers For Others

1 Answer

I know gettext and set_locale is not threadsafe. PHP should not be used with a threaded MPM.

PHP Isn't Thread-Safe Yet.
Running PHP not threaded.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...