Skip to content
Advertisement

Tag: php

Running shell_exec(‘which java’) in PHP return nothing

If I run from the command line I get the proper input (/usr/java/…/bin/java). However if I run it in a php script: nothing gets printed out for which java but I get the proper results for which ls… Answer Two things were needed: the full path to the JVM (it wasn’t set in the environment) ” 2>&1″ at the end

run php from java

Is there a way to run php server**(remote)** scripts from a java program (with secured/encrypted connection). Answer Visit (make post or get HTTP request) php page from your java program, for example, via HttpUrlConnection type

Advertisement