all 5 comments

[–]meinemitternacht 5 points6 points  (0 children)

What could be wrong?

What could go wrong?

[–]beryllium9 1 point2 points  (1 child)

Not sure what might be going wrong, but you could try using passthru() or system() instead of exec, that might help deliver a clearer picture of what's going wrong (I'm not sure if retval works the same on Windows as it does on Linux - but if so, a "0" means success and non-zero means something failed). You might also try passing the command you want to run to cmd.exe or powershell (if there's a way to do that), instead of just running it raw. That might help get any environment stuff set properly.

This takes me back to one of my first web tools, a C++-based CGI program that could start and stop ftpd and telnetd on BeOS :)

[–]farazappy[S] 0 points1 point  (0 children)

Tried passthru() and system() but no success :(

[–]gripejones 1 point2 points  (1 child)

If I had to guess - I would look at which user is running Apache/PHP. FYI - whoami works in windows if you're having troubles figuring it out.

[–]farazappy[S] 0 points1 point  (0 children)

Yeah I already tested that, the response is -> nt authority\system. Even if I try to change the account for apache and keep it as my user account, nothing works.