Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WampServer - Restart Apache from script.bat

How to restart apache from WampServer using a .bat file?

like image 206
user2093552 Avatar asked Sep 10 '26 12:09

user2093552


1 Answers

Both Apache and MySQL run as a service ( by default ) so all you need to do is stop/start the service as you would from the command line.

The Apache service is called wampapache and the MySQL service is called wampmysql

So in a batch file your would do :-

net stop wampmysql
net stop wampapache

net start wampmysql
net start wampapache

Of course you would have to run the batch file from a userid that has the privilages to stop and start services.

UPDATE for x64:

The Apache and MySQL services for 64-bit systems are called wampapache64 and wampapache64, so the command should be

net stop wampapache64
net stop wampmysqld64
like image 92
RiggsFolly Avatar answered Sep 13 '26 02:09

RiggsFolly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!