Shell_exec php not working windows
I have the following code which doesn't seem to work, however it works when I open up a command prompt and run the command:
How come it works in the command prompt but not when I execute it via PHP? I am trying to restart a Windows PC remotely. (PHP 4, PHP 5, PHP 7, PHP 8) shell_exec — Execute command via shell and return the complete output as a string Descriptionshell_exec(string
Parameterscommand The command that will be executed. Return Values A string containing the output from the executed command,
Errors/Exceptions An ExamplesExample #1 A shell_exec() example
See Also
trev at dedicate.co.uk ¶ 10 years ago
smcbride at msn dot com ¶ 1 year ago
alexandre dot schmidt at gmail dot com ¶ 6 years ago
Rgemini ¶ 13 years ago
eric dot peyremorte at iut-valence dot fr ¶ 14 years ago
tonysb at gmx dot net ¶ 20 years ago
kamermans at teratechnologies dot net ¶ 14 years ago
pedroxam at gmail dot com ¶ 3 years ago
joelhy ¶ 13 years ago
jack dot harris-7ot2j4ip at yopmail dot Com ¶ 8 years ago
Numabyte ¶ 1 year ago
saivert at saivert dot com ¶ 14 years ago
GetVolumeLabel("c");?> Anonymous ¶ 17 years ago
codeslinger at compsalot dot com ¶ 12 years ago
= shell_exec("php -s $File"); //this fails
RoBorg ¶ 14 years ago
jessop 18 years ago
wally at soggysoftware dot co dot uk ¶ 10 years ago
rustleb at hotmail dot com ¶ 16 years ago
is_resource($proc)) return 255;fclose($pipes[0]); //Don't really want to give any input$exit = proc_close($proc); Which shell? ¶ 5 months ago
martin at intelli-gens dot com ¶ 12 years ago
dburles@NOSPAMgmailDOTcom ¶ 13 years ago
gabekon at gmail dot com ¶ 14 years ago
= 'export LD_LIBRARY_PATH="' . $path_to_library_dir .'"; ' . $path_to_binary; mcbeth at broggs dot org ¶ 19 years ago
Ashraf Kaabi ¶ 16 years ago
Martin Rampersad ¶ 18 years ago
concept at conceptonline dot hu ¶ 17 years ago
Paul Cook ¶ 16 years ago
phillipberry at NOSPAM dot blisswebhosting dot com ¶ 17 years ago
php [AT] jsomers [DOT] be ¶ 17 years ago
KillAllProcesses();?> smithnigelw at gmail dot com ¶ 4 years ago
ruan at nospam dot tillcor dot com ¶ 16 years ago
rigsbr at yahoo dot com dot br ¶ 16 years ago
James McCormack ¶ 18 years ago
ricky at rocker dot com ¶ 3 years ago
|