I have a python script on a vps that I run a simple command though.
我在vps上有一个python脚本,我运行一个简单的命令。
./script.py [ipaddress] [portnumber]
example
./script.py 127.0.0.1 8080
What I'd like to do is put a simple php script on my apache server (same vps) with a form on the page to enter the ip address and port number into it.. Along with a go button.
我想做的是在我的apache服务器(相同的vps)上放一个简单的PHP脚本,页面上有一个表单,输入ip地址和端口号。还有一个go按钮。
After running the script I'd like it to display the scripts output below. IF possible (as im really just not sure) I'd like to be able to have several people use it at once... example.. 10 users all passing data to the same script at the same time.
运行脚本后,我希望它显示下面的脚本输出。如果可能的话(因为我真的不确定)我希望能够有几个人一次使用它...例子.. 10个用户同时将数据传递到同一个脚本。
My server is running CentOS
我的服务器正在运行CentOS
1 个解决方案
#1
4
popen() is what you want
popen()就是你想要的
http://www.php.net/manual/en/function.popen.php
This allows you to run an arbitrary command and get the stdout result.
这允许您运行任意命令并获取stdout结果。
#1
4
popen() is what you want
popen()就是你想要的
http://www.php.net/manual/en/function.popen.php
This allows you to run an arbitrary command and get the stdout result.
这允许您运行任意命令并获取stdout结果。