I have AMPPS installed.
My Apache server cannot handle multiple php requests at once (for example if I call localhost/script.php
multiple times, they are processed in a consecutive order). script.php
consists only of <?php sleep(10); ?>
.
I read that MaxClients directive is responsible for concurrent access configuration, but it is missing in my httpd.conf
at all.
Disabling Xdebug and writing session_write_close();
to the beginning of the script didn't work.
When I added session_start();
to the beginning of the file and my code looked like:
<?php
session_start();
session_write_close();
sleep(10);
phpinfo();
echo "Done";
When making 5 requests to localhost/script.php
, last 4 waited for the first one to end and then ended concurrently.
Please, help me resolve the issue. If any information that is needed to help me resolve this problem is missing, please notify and I will add it.
session_write_close()
should prevent session-related waits but... are sessions required to reproduce the issue? Or, in other words, does it work as expected if you removesession_start()
? Your question suggests sessions are not required at all but I wonder why you mention then. – Expirationsession_start()
code does not execute concurrently at all, requests are handled one at a time. withsession_start()
, first request is handled before others, and then the rest of requests are executed concurrently. – Glint