Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么';php睡眠在windows子系统linux中工作吗?_Php_Ubuntu_Windows Subsystem For Linux - Fatal编程技术网

为什么';php睡眠在windows子系统linux中工作吗?

为什么';php睡眠在windows子系统linux中工作吗?,php,ubuntu,windows-subsystem-for-linux,Php,Ubuntu,Windows Subsystem For Linux,该系统是WindowsWSL的Ubuntu20.04。我通过apt安装php安装php。php的版本是7.4 我在linux shell中键入php-r“sleep(2);”。但是它不起作用,立即结束。WSLV1和Ubuntu 20.04中有一个bug。 在修复程序没有出来之前,我的工作是创建自己的睡眠功能,如下所示: function waitForSec($sec) { $arr = []; $siginf = []; pcntl_sigtimedwait($arr,

该系统是WindowsWSL的Ubuntu20.04。我通过apt安装php安装php。php的版本是7.4


我在linux shell中键入
php-r“sleep(2);”
。但是它不起作用,立即结束。WSLV1和Ubuntu 20.04中有一个bug。 在修复程序没有出来之前,我的工作是创建自己的睡眠功能,如下所示:

function waitForSec($sec) {
    $arr = [];
    $siginf = [];
    pcntl_sigtimedwait($arr,$siginf,$sec);
}

干杯

有趣的是,
usleep()。