$message=shell_exec("sudo /usr/local/webserver/nginx/sbin/nginx -t 2>&1");
echo "Run result:".$message."
";
The above statement can directly execute the SHELL statement in PHP
If there is a return value, then 2>&1 is required He will redirect the output strerr to strout output!
Otherwise the return result will be empty!