[英]How do I run a process from PHP
I need to start a Unix process by calling a PHP-page through the web. 我需要通过网络调用PHP页面来启动Unix进程。 I also need to send some arguments to the PHP-page that gets substituted into the command in a save way.
我还需要发送一些参数到PHP页面,该页面以保存的方式替换到命令中。
看一下exec()
和escapeshellarg()
:
exec('command -param=' . escapeshellarg($_GET['argument']));
如果您需要对IO的更多控制,请查看: http : //php.net/manual/en/function.popen.php http://php.net/manual/en/function.proc-open.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.