Stopping and Starting Apache Using PHP (!)

Posted by Abs on Stack Overflow See other posts from Stack Overflow or by Abs
Published on 2010-04-30T14:36:39Z Indexed on 2010/04/30 14:47 UTC
Read the original article Hit count: 192

Filed under:
|
|
|
|

Hello all,

I have two problems which are related.

1) I have a batch file that contains this:

net stop wampapache
net start wampapache

Which tries to stop and start my wamp server. When I double click the stop.bat file with the above it works successfully. When I try to run that from my PHP script, it stops the server but doesn't start it fully which I am guessing is because Apache is waiting for that PHP process to exit?

function php_kill(){

    exec('stop.bat', $output = array(), $return);

    return $return;

}

2) Is there a way to restart my webserver (apache) whilst keeping session variables that PHP needs available?

Thanks all

© Stack Overflow or respective owner

Related posts about php

Related posts about apache