结果是:www git version 1.7.1 221601.89 879803.10 DirectMap2M: 2088960 kB 0.39 0.24 0.21 1/167 5584
这个函数可以轻松的实现在服务器上执行一个命令,非常关键,一定要小心使用。
但是其缺陷是返回值不太好处理。
PHP file_get_contents 或者 file
file_get_contents 函数可以将整个文件读入一个字符串,方便处理。
file 函数可以整个文件读入一个数组中。
例如在PHP探针文件中使用file函数读取的。
但是如果服务器限制了open_basedir,将会遇到以下错误。Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/proc/loadavg) is not within the allowed path(s): (/home/wwwroot/blog_lixiphp_com:/tmp) in /home/wwwroot/blog_lixiphp_com/public_html/test/inc/fun.inc.php on line 196
解决方法是在虚拟目录中关闭open_basedir。
(...)
Read the rest of PHP查看服务器信息内存、负载等 (13 words)
© lixiphp for LixiPHP, 2013. | Permalink | No comment |
Add to del.icio.us
Post tags: command, Linux, PHP, 内存, 服务器, 负载
Feed enhanced by Better Feed from Ozh
本文原创发布php中文网,转载请注明出处,感谢您的尊重!