Jump to content

Start a service with exec


ierpe

Recommended Posts

hey,

 

I need to stop and start a server application (on a windows system).

The command line to start/stop the service is: net start blipserver or net stop blipserver

 

I'm trying to execute with exec but it doesnt work. Does someone knows if something special has to be done in order to be able to start/Stop services in windows?

Link to comment
https://forums.phpfreaks.com/topic/151884-start-a-service-with-exec/
Share on other sites

Actually this is a local script, using php-cgi. Im using php here as a "shell scripting" since im never working on windows and that the scripting under windows is just a pain.

 

Im using php here to connect to a server via ftp, if a new file has been uploaded, compare it, if different from last downloaded file, download it, stop the server, update application, restart server.

 

And it works, i just did exec('net start blipserver', $output, $return_var);

 

I know this wouldnt work for a web application, I forgot to precise i was using php in this case more as a shell script!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.