Reputation: 123
When I try to pass a short string it passes, and when I try to pass a longer string It doesn't pass.
Here's the code I'm using :
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));
Is there any solution to pass a longer string ?
Upvotes: 0
Views: 160