PHP in osx yosomite is unable to execute following code successfully.
<?php
exec("java -version 2>&1", $output, $returnValue);
print_r($returnValue);
print_r($output);
?>
The output I get is
1Array ( [0] => No Java runtime present, requesting install. [1] => 2015-07-16 21:25:05.588 java[1434:49304] JLRequestRuntimeInstall: Error calling: CFMessagePortCreateRemote )
I can run it successfully from command line. I tried changing the apache user but it didn't help.