gpt4 book ai didi

PHP 使用线程安全与否

转载 作者:可可西里 更新时间:2023-11-01 12:37:53 24 4
gpt4 key购买 nike

我正在为 Windows 2008 R2 64 位服务器上的生产服务器构建 Web 服务器安装

我已经安装了 Apache 2.4 64 位并且运行良好

下一步,PHP

我已经阅读了线程安全与非线程安全之间的区别,但似乎无法理解我应该使用哪个(以及为什么)。

谁能确认我当前的设置应该使用哪个 PHP 安装?

最佳答案

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.

例如,如果您在 Apache 中使用 FastCGI,请选择非线程安全版本,如果您使用 LoadModule,请选择线程安全版本。

关于PHP 使用线程安全与否,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17616387/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com