Hi,
How do I close apache and mysql from php?
Would I need to use a dll as it will be running on windows machine? The environment is apache 2.0, mysql 5.x, and php 5.
Thanx
are you asking how to shut down the webserver via PHP?
This sounds like a dangerous question to answer... but it's a shell issue. Basically you need to figure out whatever the commandline is to stop the service (since you're talking windows) and then run it via shell_exec() or one of the similar functions. Usually the command line is something akin to NET STOP APACHE2
But be warned, this is best used for CLI PHP, I'm not really sure how the script would respond to having Apache shutdown if it was also in charge of running it.
Hi Skiflyer...
To put your mind at ease...I'm not looking to shutdown a public web server but rather a portable web server running from a usb flash drive. I got it to start now not sure how to get it to stop when the user wants to quit.
Thx
hmmm...
To try figure out the command has been the tough one. You see apache is run as a console (being portable one does not want to run it as a service) and the major issue is that when the user escapes/quits from the app I need the console window to either be hidden or closed. Can't seem to get it right!
oh and btw, I'm curious, and would gladly like to help, but I'm mostly guessing and poking around helping you find the right apache command line, so you might be better off in the apache forum at this point
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.