PHP exec on Windows Server 2008

I installed PHP as a module in IIS on Windows Server 2008, with great difficulty I try to execute programs from the command line from a PHP script.

I can execute the php code using php-cgi.exe and php-cli.exe, which makes me think that this might be an access issue.

However, I can execute some commands, such as shutdown.exe and dir.

I tried the same process in an ASP.NET file and have exactly the same problem.

Basically, I would like to do this:

Exec ("path to the EXE file");

And actually it works.

+3
source share
2 answers

Try

exec('path-to-exe-file 2>&1', $output);
var_dump($output);

2 & 1 stdout ( win32), $output.

+1

, , ...

IIS, , , , , :

ProcessModel.Identity = LocalSystem

ProcessModel.Load = true

0

Source: https://habr.com/ru/post/1715495/


All Articles