Closed emresaracoglu closed 6 years ago
You need to pass the $firstWords
variable to your script. Then use $argv[1]
to read the content.
$firstWords = "Hello World";
$process = new BackgroundProcess('/usr/local/bin/php /home/[...]/test.php "'.$firstWords.'"');
A tip for debugging this. echo
the string you pass into new BackgroundProcess
, copy it and execute it in a Terminal window. If it works in the Terminal it should work in BackgroundProcess.
Yes, That's all! This script will make my job really easy, thank you for this script and answer @florianeckerstorfer Have a nice day.
Hi,
test.php:
echo "This is first words: ".$firstWords; // print: "This is first words: ";
The strings do not reach the other page. I wanted to use argv in Cron for this. (link) it still did not work.
what is your idea on this issue? Thanks