Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在需要 tty 的 PHP 中执行 shell_exec?
<?php $output = shell_exec("read foo; echo $foo"); ?>
如果没有,有什么替代方案?
关于什么:
<?php echo shell_exec('read foo; export foo; echo $foo');
注意:脚本退出后,您的 shell 中将无法使用 var foo。