i am having a very unusual problem related to PHP shell_exec(). well, i am actually going to execute external java program. i make a test like this
<?php
$command = 'C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\java.exe';
$val = shell_exec($command);
echo('command:' . $command);
echo('<BR>');
echo('val:' . $val);
?>
everything is OK, but when i am trying to do this
<?php
$command = 'C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\javac.exe';
$val = shell_exec($command);
echo('command:' . $command);
echo('<BR>');
echo('val:' . $val);
?>
no output produced. really odd. i have also tried to use exec() but no different. the next odd thing is when i am try this one
<?php
$command = 'C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\java.exe -version';
$val = shell_exec($command);
echo('command:' . $command);
echo('<BR>');
echo('val:' . $val);
?>
i use the exact java.exe but add a -version as an extra option. no output come up.
either java.exe and javac.exe give output when they are executed in the command line. i use Win 7 64bit, XAMPP 1.8.1 (Apache 2.4.3, PHP 5.4.7) and JDK 1.6 update 35.
i searched about this thing here, and tried to implement answer given to the related question, but they don't solve.
any explanation related to this,.? thank you for helping :)
stderr? Try appending2> C:\\stderr.txtto your command, run it again and see if there is something inC:\\stderr.txt