更新时间:2022-04-18 04:46:59
我也遇到了这个问题,事实证明这是php中的错误(#11430).解决方法是在php脚本中调用另一个php脚本时使用php-cli.因此,您仍然可以使用exec,而不是在浏览器中调用php-cli时使用php:
I had this issue also and it turns out this is a bug in php (#11430). The fix is to use php-cli when calling another php script within a php script. So you can still use exec but rather than use php use php-cli when calling it in the browser:
exec("php-cli somescript.php");
这对我有用.