The maximum number of concurrent connections for php built into the development server

I ran into a problem using php built into the web server as it apparently only allows one simultaneous connection.

I found this when testing some concurrent ajax requests that all seemed to complete at the same time.

This is not very important, since I can always run apache (this is how I came to the conclusion above), but I'm used to running php directly from my IDE.

Is there a way to increase this, or is this a php restriction?

my sample code that is blocked by the embedded server but works fine on apache:

$.ajax({ type: "POST", url: slow.php, data: "", success: function(data){ clearInterval(checkid); console.log('slow call finished'); } }); checkid = setInterval(function(){ $.get('somefile.txt', function(data){ console.log('quick call finished'); }); },1000); //slow.php sleep(10); echo 'all done'; 
+6
source share
1 answer

Quote from manual :

PHP applications will stop if the request is blocked.

So yes, this is single threaded. In addition, this is just development assistance, in practice you will rarely use it anyway, since it does not support important external technologies, such as FallbackResource , mod_rewrite and .htaccess , which are intertwined with most web projects.

Modern IDEs, such as support for PhpStorm auto-deploy on save , local and remote web servers, which are much more practical in projects larger than a few files.

+8
source

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


All Articles