Note that there are some explanatory texts on larger screens.

plurals
  1. POAvoid JVM startup delay when running JAR through PHP using exec
    primarykey
    data
    text
    <p>Is there any way to avoid the delay caused by the JVM starting up each time you run an exec command in PHP?</p> <p>I have two JARs for encryption and decryption that I need to run using PHP. Both run on the same script although one decrypts a URL parameter and then the other encrypts some other information. When I run them through the command line, they both finish in less than 0.4 seconds each. However, when I run them using the PHP exec function, a new instance of the JVM is started which adds 5 seconds onto each JAR execution time.</p> <p>I have investigated using Nailgun but can't get that to work. I can't find any documentation for getting it to run a JAR and when I use classes, it can never find them either.</p> <p>I have also considered using PHP/Java Bridge. I would prefer however to continue using exec. I am already running IIS 7.5 and I am not sure how one would configure the bridge to work with this.</p> <p><strong>My question is this: <br>Is there any way to keep the JVM running in the background in such a way that the PHP exec function does not need to start a new instance each time? I think there must be a way as there is no delay through the command line.</strong></p> <p>If there is no way of doing this, then I am open to other suggestions. 11 seconds to run a PHP script means that visitors to the website will most likely leave.</p> <p>Additional information that may or may not be of use: <br>It will be running on Windows Server 2008 R2 32-bit OS. <br>Local access required only. <br>IIS server 7.5 being used. <br>Website is coded in PHP. PHP version is 5.3.5. <br>Server is running the latest JRE - Java7 u6 </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload