0

when I execute a java file using php command

exec('java test2');

it runs perfectly, while when I do the same thing on the web-server, it does nothing I am unable to find the reason, can anybody please tell me the possible reason, thanks in advance

1
  • Are you sure Java is installed on your web server and that you're permitted to use it? Commented Apr 24, 2011 at 17:36

2 Answers 2

1
  • Do you have Java installed in your web server?
  • Is it added to your PATH?
  • Does your webserver user have execution permissions on it?
  • Do you have enough memory available as to start a JVM?

There are so many reasons why this could fail. Try logging into your server via ssh and execute 'java -version'.

Sign up to request clarification or add additional context in comments.

Comments

1

Make sure you specify

-Djava.awt.hedless=true

in your java command

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.