Home > php教程 > php手册 > linux exec 和 shell_exec函数

linux exec 和 shell_exec函数

WBOY
Release: 2016-06-13 11:25:13
Original
1117 people have browsed it

  

popen,passthru,proc_open,shell_exec的返回结果如下:

 

[root@krlcgcms01 shell]# php test.php     1001.log     10.log     10.tar.gz     aaa.tar.gz     mytest     test1101     test1102     weblog_2010_09     我能发现的就这几个函数,能执行linux下的命令,我想应当还有吧,欢迎大家补充。


  一般情况下,很少会用php去执行linux命令,不过特殊情况下,你也许会用到这些函数。以前我知道有二个函数可以执行linux命令,一个是exec,一个是shell_exec。其实有很多的,结合手册内容,介绍以下6个函数。

  1,exec函数

  

  返回结果如下:

 

[root@krlcgcms01 shell]# php ./exec.php     array     (      [0] => 1001.log      [1] => 10.log      [2] => 10.tar.gz      [3] => aaa.tar.gz      [4] => mytest      [5] => test1101      [6] => test1102      [7] => weblog_2010_09     ) 


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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template