Jump to content
The Uniform Server Community

can't start Windows processes the background with phpcli


mixersoft
 Share

Recommended Posts

I have the both the Uniserver and WAMP5 running. The following line starts a process in the background with the WAMP5 installation, but with the Uniserver, the process starts in the foreground with the title of the command window set to "bla".

 

pclose(popen("start \"bla\" \"".$path_phpexe.$phpexe."\" -f W:/www/services/xmlrpc.php " . $args, "r"));

 

Any suggestions?

Link to comment
Share on other sites

So the title is set to blah?

 

yes. I'm no expert on the windows start command, but I'm assuming that bla are switches, one of which puts the process into the background.

 

regardless, the same script on the same desktop works fine with WAMP5, but not the uniserver.

 

WAMP5 = php5.2.1

uniserver = php 5.1.1

 

Is that the reason, or am I doing something wrong?

Link to comment
Share on other sites

oooooo.. oooo... so your problem is the fact that the windows command window shows? does it stay?

 

Yes, the command window shows with the title set to 'bla', the switches. The command window closes when the process is complete.

 

With WAMP5, the process starts in the background, without a command window.

Link to comment
Share on other sites

pclose(popen("start \"bla\" \"".$path_phpexe.$phpexe."\" -f W:/www/services/xmlrpc.php " . $args, "r"));

 

The start command starts a new command window, the first parameter, if in quotes, is taken as the Title hence the reason you see "bla" in the title bar.

 

The line looks wrong why use start! popen should just run the program as is with the "r" argument

 

Try this and see if it works

 

pclose(popen("$path_phpexe.$phpexe."\" -f W:/www/services/xmlrpc.php " . $args, "r"));

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...