locking - php blocking when calling the same file concurrently -


I have some strange problems.

I've written a file manager in PHP Download files - which works fine, the entire script is created as a large file.

Now, while downloading a large file, I am not able to use the script at the same time, say, browsing folder content. It's nothing but keeping loading as soon as the download is complete, everything works again.

Is there something that prevents PHP from parsing the same file concurrently? Because other scripts have to work like magic, no matter if I am downloading or not.

The help or documentation link is highly appreciated :)

Do you use sessions?

If so, this problem is probably the default session handler uses the files that will be locked when the session-enabled code is executed. Practically this means that each user executes PHP files sequentially. To solve this, you should use a custom session handler which uses DB. Read.

Edit: I want to say that writing a custom session handler with any locking can be difficult and can present many subtle bugs, read more documentation on this if you need to do it!

EDIT 2: Sometimes using session_write_close () to close the session is not enough (see comments).


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -