WebFaction
Community site: login faq

I have installed jre 1.8 and set a bash alias so "java -jar prog.jar" runs correctly from an ssh prompt. Now I'm trying to run prog.jar from a php script and collect the result.

exec("java -jar prog.jar", $result, $ret);

echo "result".$result;

echo "return".$ret;

but all I get back are the strings "result" and "return"

Any ideas what might be going on here?

asked 05 Jun '16, 15:01

stegzzz
17715
accept rate: 66%

edited 05 Jun '16, 15:04


sorted the problem. the php environment isn't the same as the bash shell environment, so php couldn't see a path alias I had defined, hard coding the path alias in the php script fixed it.

permanent link

answered 05 Jun '16, 20:37

stegzzz
17715
accept rate: 66%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×263
×22

question asked: 05 Jun '16, 15:01

question was seen: 3,416 times

last updated: 05 Jun '16, 20:37

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM