Home > Backend Development > PHP Tutorial > Parsing how to directly execute SHELL_PHP tutorial in php

Parsing how to directly execute SHELL_PHP tutorial in php

WBOY
Release: 2016-07-21 15:02:11
Original
799 people have browsed it

$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!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327946.htmlTechArticle$message=shell_exec("sudo /usr/local/webserver/nginx/sbin/nginx -t 2 echo " Running result: ".$message."br/"; The above statement can be directly executed in PHP. If there is a return value, then...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template