How to make php scripts run in parallel?

无人久伴 提交于 2019-11-28 05:27:55

问题


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:


Try

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

Related: Thoughts on PHP sessions



来源:https://stackoverflow.com/questions/6618026/how-to-make-php-scripts-run-in-parallel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!