[英]How Can I Run Multiple .PHP Scripts Same Time On WAMP?
我正在尝试同时运行多个 PHP 脚本文件(在 chrome 浏览器中),但似乎 WAMP 限制为最多 8 个。允许超过 8 个的正确设置应该是什么? 是否可以像在 NGINX 中一样运行 httpd.exe 实例的多个工作程序?
我认为您必须在 apache 配置中更改maxclients
。 你的配置必须是这样的:
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
有关更多信息,请查看: http : //fuscata.com/kb/set-maxclients-apache-prefork
您遇到的问题可能与服务器无关,而与浏览器有关。 浏览器只允许有限数量的同时连接到某个服务器,所以如果你想克服这个限制,你将不得不使用不同的服务器。
例如,您可以在 hosts 文件中执行此操作,使用不同的名称路由到同一主机(为清楚起见,在不同的行中):
127.0.0.1 server1.local
127.0.0.1 server2.local
127.0.0.1 server3.local
127.0.0.1 server4.local
etc.
现在你可以有 8 个(我认为 Chrome 是 6 个)到server1.local
连接,8 个到server2.local
等等。
编辑:有关更多信息,请参阅此问题。
去 :
<xampp_root>/xamppfiles/etc/httpd.conf
并确认以下未注释:
# Server-pool management (MPM specific)
#Include <xampp_root>/etc/extra/httpd-mpm.conf
(显然,将评论本身留下评论并取消注释下面的行)。
然后去:
<xampp_root>/etc/extra/httpd-mpm.conf
并确认该行的值:
MaxClients 150
大于 8。
根据这个建议,如果你想增加每个 SINGLE 用户的并发执行量,你应该关闭:
session.auto_start
(您可以使用phpinfo()
检查它是否已打开)
或内部脚本(如果会话是独立启动的,例如:
session_start();
// do stuff, read vars etc...
session_write_close();
// do something that takes a long time....
session_start();
// now update sesson vars with the result
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.