PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, February 14, 2022

[FIXED] Allow clients to run multiple simultaneous PHP requests

 February 14, 2022     mamp, php     No comments   

Issue

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?


Solution

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.



Answered By - CragMonkey
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing