简体   繁体   English

php exec崩溃,没有输出

[英]php exec crash with no output

I need to check why my exec function stops my php script. 我需要检查为什么我的exec函数会停止我的php脚本。

I call a bat file in "exec" function (but i have the problem to with passthru, system and proc_open) in my HTTP query and after 2min i got an error code 500 (with no details). 我在HTTP查询中的“ exec”函数中调用了一个bat文件(但是我遇到了passthru,system和proc_open的问题),并且2分钟后,我得到了错误代码500(没有详细信息)。 But my bat file is always running in background (i can see files created...) I use it like this : 但是我的bat文件始终在后台运行(我可以看到创建的文件...),我这样使用它:

exec('cmd /c myScript.bat "myParam" 2>&1 &', $output);

In $output i get nothing, in php error_log nothing... I've added this parameters : 在$ output中我什么也没有,在php error_log中什么也没有...我添加了以下参数:

ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
set_time_limit(0);
error_reporting(E_ALL);

Same result... 结果相同...

I'm on PHP 7.2 and IIS 8. 我使用的是PHP 7.2和IIS 8。

OP found found a solution to the 2-minute-timeout issue: OP找到了解决2分钟超时问题的解决方案:

  • The problem was in config of IIS, in applicationHost.config. 问题出在IIS的applicationHost.config中。
  • I have to change activityTimeOut in correct FastCgi. 我必须在正确的FastCgi中更改activityTimeOut

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM