How to run a external program in PHP?

Does this PHP script run multiple instances of Java program?

  • Hi, I have multiple PHP scripts that execute the same Java program but with different arguments. I wanted to know if a new instance of the Java program is being started by each script, or is it the same one? exec("java -jar SomeProgram.jar $insertedPageId", $output); The above line of code is what i have, from each script there is a new $insertedPageId being passed.

  • Answer:

    Yes, Multiple instances are started each time unless the Java programme is designed to handle everything in one session. The PHP starting the program is same as you using a terminal to start the program, if you type multiple launch commands multiple sessions are launched. Except for in case like firefox which will open the new request as a tab and not as a new firefox session.

Blaise M Crowly at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.