1

How can I allow one client to run multiple simultaneous PHP requests?

I've been googling a lot. I tried session_write_close() at the top of my PHP script.

I tried to edit the httpd.conf but nothing bites.

What should I do?

user1878980
  • 485
  • 1
  • 8
  • 20

1 Answers1

0

Sounds like you're looking to perform an asynchronous request (AJAX), and jQuery is useful for this.

Check out the jQuery.ajax() documentation.

There are plenty of tutorials online to help you get started with jQuery, and this SO post discusses how to make Multiple ajax calls at same time.

Edit: Since you clarified in your comments that:

  • You are already using jQuery but are running into challenges with the server allowing multiple simultaneous connections.
  • You also indicated that you already tried adding missing values to httpd.conf and restarted your Apache server.

If adding missing settings to httpd.conf doesn't work and you have also checked that they are not already included in httpd.conf through, perhaps, httpd-mpm.conf.

Your OP indicated that you have tried resolving the session conflicts using session_write_close(), but perhaps the additional requests are getting discarded/ignored rather than queued. You could try replacing the default file-based session handler with one that calls a database, which should eliminate the problem of conflicts that arise when two processes attempt to read the same session file at the same time. This article (Saving PHP's Session data to a database) seems to cover it pretty well.

Community
  • 1
  • 1
CragMonkey
  • 634
  • 1
  • 6
  • 19