/receive.sh url=http://www.site.com cert=certs/test_lv.p12?test_lv > /dev/null 2>/dev/null &
I need to run this command throw a php.
$response2 = shell_exec("./receive.sh url=https://www.site.com cert=certs/test.p12?test_lv > /dev/null 2>/dev/null &");
echo $response2;
It's returned an empty string. Thanks for answers!
Updated* I ad开发者_Go百科ded an ouput PID and it works! Thanks to all!
./receive.sh url=https://www.site.com cert=certs/test_lv.p12?test_lv > /dev/null 2>/dev/null & echo $!
I think you code has a bug since it already redirects the output to /dev/null in your command , just try to remove the output redirection and it may work
shell_exec returns the output stream. Your command may print the process id to the error stream and that's why you get an empty string.
Here you can see how to print the error stream. I am not sure if that's your case but give it a try.
Check out popen.
精彩评论