运行虚拟服务器上的外部程序 [英] run external programs on virtual server
本文介绍了运行虚拟服务器上的外部程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要安装到一台服务器,通过(Linux操作系统)的命令行访问的小程序,并与PHP运行它们。
我想安装Apache,我的机器上的虚拟主机...
有没有办法到我的系统上运行我的虚拟服务器上的这些外部应用程序,这样我就可以尝试用PHP调用?
I want to install small programs accessible through the command line (of linux OS) to a server and run them with PHP. I want to install Apache, vhost on my machine... Is there a way to run these external applications on my virtual server, on my system, so i can experiment with PHP calls?
推荐答案
我们做的正是这一切的时候。我打电话给他们巫术页面。下面是一些工作code:
We do exactly this all the time. I call them voodoo pages. Here's some working code:
<?php
$command="uptime"; $output; $retval; $errors="";
exec ( $command , &$output, &$retval );
echo $output[0]."\n";
unset($output);
?>
和输出到网页服务的:
13:40:19 up 22 days, 23:14, 0 users, load average: 0.04, 0.02, 0.00
这篇关于运行虚拟服务器上的外部程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文