-2
当我尝试传递一个短字符串时,它会通过,当我尝试传递一个较长的字符串时,它不会通过。通过执行传递长字符串
下面是我使用的代码:
的index.php
function bgExec($cmd) {
if(substr(php_uname(), 0, 7) == "Windows"){
pclose(popen("start /B ". $cmd, "r"));
}else {
exec($cmd . " > /dev/null &");
}
}
$string = "some long string";
bgExec("php -q process.php $string");
process.php
file_put_contents('file.txt', print_r($argv[1], true));
是否有任何解决方案,通过一个较长的字符串?
你只是知道如何downvote:/试图帮忙而不是downvoting – Mohamed