【发布时间】:2012-02-04 09:00:40
【问题描述】:
PHP 是否可以执行命令从而替换当前进程? 就像在 C 或 Ruby 中一样:
exec('ls')
# should not get here
【问题讨论】:
PHP 是否可以执行命令从而替换当前进程? 就像在 C 或 Ruby 中一样:
exec('ls')
# should not get here
【问题讨论】:
试试pcntl_exec:http://se.php.net/manual/en/function.pcntl-exec.php
【讨论】:
pcntl_exec($_SERVER['_'], array('-ad', 'auto_prepend_file=/path/to/library'))。 $_SERVER['_'] 是 php 解释器的路径。