开发者

apache not multi process the same php

I create one php to send one file, but before send this file need to check some situations, one situation is a maximum access, can only exist 5 download file per time.

I create php but apache processing one request per time, not all in the same time.

e.g if I make 3 request and put sleep(3) in php file, first request slow 3 seconds, second 6 seconds, and third 9 seconds.

I`m Not underst开发者_如何学编程and much about php and apache. anyone can help me ?


If you use sessions, session is locked per request, so the second, third etc. request must wait until the first finish the process.

If you expect another request while a long process running with the same session you should call

session_write_close() http://php.net/manual/en/function.session-write-close.php

explicitly. But only if you don't want to write to the session later in the process.

Edit:

If you want to reopen the session later, you can call

session_start() http://hu.php.net/manual/en/function.session-start.php

(before any output).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜