3

script1.php

<?php
session_start();
sleep(10);

script2.php

<?php
session_start();

I run script1.php in the browser and immediately after script2.php in another browser window. session_start() in script2.php can't execute until script1.php is not finished executing.

Why it happened and how to make php scripts run in parallel?

1
  • How is your webserver configured? Commented Jul 7, 2011 at 22:48

1 Answer 1

4

Try

<?php
session_start();
session_write_close();
sleep(10);

Related: Thoughts on PHP sessions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.