简体   繁体   English

PHP exec在Windows和Apache中在后台运行,但未在Nginx中运行

[英]PHP exec running in background with Windows & Apache but not Nginx

I have tried both Apache/PHP and Nginx/PHP with nearly the same configuration. 我已经尝试了具有几乎相同配置的Apache / PHP和Nginx / PHP。

I am running this script: 我正在运行此脚本:

<?php
exec("calc.exe");
?>

In Apache/PHP, calc.exe is not opened but is found running as a background process. 在Apache / PHP中,未打开calc.exe,但是发现calc.exe作为后台进程运行。 In Nginx/PHP, calc.exe is opened properly. 在Nginx / PHP中,可以正确打开calc.exe。

I would like to use Apache/PHP to open calc.exe properly. 我想使用Apache / PHP正确打开calc.exe。

Exec has no functionality with display, it will spawn processes and such under a different user (thus no affect on the current logged in user) Exec没有显示功能,它将在其他用户下生成进程等(因此不会影响当前登录的用户)

Scenario; 情景; your logged in as User1 您以User1身份登录

On php do the following; 在php上执行以下操作;

 Exec("whoami");

You will see a different user which apache/web service is running as 您将看到以apache / web服务运行的其他用户

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

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