开发者

How to make php scripts run in parallel?

开发者 https://www.devze.com 2023-03-18 08:03 出处:网络
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.

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?


Try

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

Related: Thoughts on PHP sessions

0

精彩评论

暂无评论...
验证码 换一张
取 消