PHP exec在后台运行Windows和Apache而不是Nginx
问题描述:
I have tried both Apache/PHP and Nginx/PHP with nearly the same configuration.
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. In Nginx/PHP, calc.exe is opened properly.
I would like to use Apache/PHP to open calc.exe properly.
答
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)
Scenario; your logged in as User1
On php do the following;
Exec("whoami");
You will see a different user which apache/web service is running as