2

Well, I have a web application with multiple tools. One such tool sends a simple Ajax request at the same PHP script, which in turn sends an HTTP request via Curl, but the problem is that this request takes a long time.

As this process takes a long time, I can not perform other tasks within the application, so I expect to complete the process in order to use other tools.

How I can assign or enable PHP to use multiple children or processes?

In this particular case, I don't need and don't want to use Thread Class, or "exec" for execute via command line.

Explanation of the problem:

I have script for upload file, but when I upload file(with big size), this script take a long time, so while loading the file, I would like to see my history of uploaded files. To this should open another tab in the browser with the URL history uploads. The problem is that when I open the record, this is left "waiting" until the other tab finishes loading (when finished upload the file).

(I thing)The problem is that PHP handles all in the same process/thread and this prevents you use multiple script at once(with multiples tab on browser).

So my problem is that I need to run multiple processes at the same time, without waiting for any of the process finishes running.

I am currently working with Linux Centos 7 servers, with Apache + PHP 5.4 and 4GB of RAM allocated to PHP.

Thanks

Olaf Erlandsen
  • 5,817
  • 9
  • 41
  • 73
  • This sounds like apache's HTTP pipelining. It's not a PHP problem, it's apache's fault (and one of the reasons why I use nginx over apache). Basically, apache will not serve you until it's done processing the prior request. Interesting thing to note is that it will serve *another* user which isn't you. I suggest reading about pipelining and how to disable it. – N.B. Oct 12 '15 at 22:51
  • Right now i use a DV from MediaTemple (mt), and this by default have Nginx with Apache and PHP. Can u tell me how to "repair/fix" with this features? )) – Olaf Erlandsen Oct 12 '15 at 23:19
  • Googling how to disable http pipelining should help. The easiest and usual way is doing this on client side or - your browser. Trying to do this on server-side will lead to gray hair, lots of hours spent and a lot of frustration. Also, side question - did you use Chrome or Firefox for this? – N.B. Oct 12 '15 at 23:42

0 Answers0