Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Use thread safe or not

I am building a web server install for a production server on a windows 2008 R2 64 bit server

I have installed Apache 2.4 64 bit and that is working fine

Next step, PHP

I have read about the differences between thread safe and not but just cant seem to grasp which I should be using (and why).

Can anybody confirm which PHP Install I should use with my current setup?

like image 476
MarkO Avatar asked Jul 12 '13 13:07

MarkO


2 Answers

You should look at the PHP docs:

Thread Safety means that binary can work in a multithreaded webserver context, such as Apache 2 on Windows. Thread Safety works by creating a local storage copy in each thread, so that the data won't collide with another thread.

So what do I choose? If you choose to run PHP as a CGI binary, then you won't need thread safety, because the binary is invoked at each request. For multithreaded webservers, such as IIS5 and IIS6, you should use the threaded version of PHP.

So for example, if you use FastCGI with Apache, go for the non-thread safe, and if you use LoadModule, go for the thread-safe version.

like image 63
jh314 Avatar answered Sep 20 '22 12:09

jh314


"With Apache you have to use the Thread Safe (TS) versions of PHP." from the download page if anyone else is ever looking.

like image 35
Aaron Harker Avatar answered Sep 20 '22 12:09

Aaron Harker