[英]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.