0

I have a php script that I want to use to start my solr jetty server. Something like this:

chdir("C:/solr-4.4.0/solr-4.4.0/example/");
echo getcwd();
exec("javaw -jar start.jar > output.log 2>&1 &");
echo 'done';

The problem is that if javaw.exe is not already running, the php script hangs and waits for it to finish. I thought that redirecting the output and adding the & to the end would take care of this but it doesn't....

QUESTION:

Is there way to start this process (javaw.exe), let it run in the background and continue executing the rest of my php script?

(WINDOWS 7 PRO 64 BIT)

A.O.
  • 3,733
  • 6
  • 30
  • 49
  • your using linux syntax on a windows server –  Mar 06 '14 at 19:29
  • 1
    @Dagon what exactly is the problem with my syntax? the command executes, starts javaw.exe, and redirects the output to the log....i just dont want php waiting for a response, just start it and move on... – A.O. Mar 06 '14 at 19:30

1 Answers1

0

for windows:

$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run("javaw -jar start.jar > output.log", 0, false);