What does PHP do when I press ESC?

Suppose I have a fairly long PHP script that takes exactly 60 seconds.

I connect to mysite.com/thatscript.php, I'm sure it’s connected, then the script runs. After 5 seconds, I ran. Then I press Ctrl + R and wait another 5 seconds, then repeat 12 times.

What will happen and why?

/ edit: I really tested, and it keeps me waiting, but I can't tell if Apache is expecting me or another concurrent script or something else.

+4
source share
1 answer

It depends on what PHP is doing.

Pressing esc usually stops the browser from loading the page.

If you are also using a session for a long script, then all other requests will wait for the previous script to complete due to session blocking.

Session-related lock: How to lock session_start in PHP?

If you want to control how PHP handles the user stopping the request, follow these steps: http://php.net/manual/en/features.connection-handling.php

+5
source

Source: https://habr.com/ru/post/1435616/


All Articles