71

I am using XAMPP, version 3.2.1. I just installed it on Windows 8. Every time I need to go to the XAMPP Control Panel to start services (MySQL, Apache,...); in Windows 7 it started automatically when Windows came up.

Is there a way I can make it auto-start in Windows 8 too?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user385729
  • 1,924
  • 9
  • 29
  • 42
  • 5
    Why did you delete the answer? It solved my problem! I was about to mark it as "Solved"; but you deleted it! Thanks anyway :) – user385729 Jan 06 '14 at 22:21
  • 6
    For other people who may reach this topic by Search engines: On XAMPPControl Panel : top right corner: check Apache,MySQL,.. to auto start :) – user385729 Jan 06 '14 at 22:23
  • @user385729 Trouble is you have to open the control panel before they start. ;) – Brett Dec 29 '15 at 04:54

12 Answers12

158

Start the control panel using "Run as administrator". Then you can install Apache and MySQL as a service:

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mihaita25
  • 1,711
  • 1
  • 11
  • 8
  • 6
    You also need to stop the module you want to install as a service then click the "Service" check-box on the left and answer "yes" to the message that pops-up. Unfortunately it doesn't work for Filezilla for some reason. – Glenn Lawrence Jul 21 '14 at 02:01
  • 8
    I think xampp should have a dialog/hint box that shows up when you try and click Service when it's not run in Administrator, that it is require just so it can inform people. – WORMSS Feb 19 '15 at 14:39
  • 5
    There should be a greyed-out button when not in admin mode and a tooltip "run XAMPP as administrator to use". XAMPP people get some UX guys. – Pawel Mar 05 '15 at 15:09
  • 10
    Looks like they changed something. Had to edit the xampp-control.ini file and set values to 1 to be able to this. [EnableServices] Apache=1 MySQL=1 – KoalaBear Aug 08 '15 at 23:47
  • Solution is from KoalaBear as I was having the same problem running as admin, and now you have to manually enable service in config ! – Stéphane Bourzeix Oct 24 '16 at 14:15
  • 1
    I am sorry to have to downvote this reply. But justifiably so: It's really amazing that some people answer w/o having fully read the questions (or ignoring key words in them, on purpose just to reply?) ! Here, the person misses the key word "Automatically" (in fact, with capital first letter!). And it is invalidating to recommend starting Apache service from the control panel ... as if the asker couldn't do it by himself!! And I am even *more* amazed that this reply received so many votes!!! So, besides this reply being out of place it is also bad. – Apostolos May 02 '17 at 16:18
  • 1
    -> Config (upper right button) -> Autostart modules -> select Apache (and whatever other) checkbox. Now, it is a working reply. – Apostolos May 02 '17 at 16:25
  • If checkboxe are still uncheckable try my answer: https://stackoverflow.com/questions/20960296/how-to-start-apache-and-mysql-automatically-when-windows-8-comes-up/45413206#45413206 – bato3 Jul 31 '17 at 10:24
  • @Apostolos what you are suggesting says "Selected modules will be started on the next launch of the control panel" which I guess isn't what OP wants. – iWasCloud Jun 22 '22 at 10:44
71

Go to the Config button (upper right) and select the Autostart for Apache:

Config button

Autostart modules

To start XAMPP at startup in Windows, paste a shortcut of the XAMPP control panel in this folder:

C:\Users\ USERNAME \AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

or

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Andres
  • 10,561
  • 4
  • 45
  • 63
  • selecting autostart starts the selected modules ("apache" and "mysql" here as i have selected these two modules) but not the 'xampp control panel' itself. we need to start the contol panel manually (i am not sure on other version but on 'xampp contol panel v3.2.1 '). To start the control panel itself with the services/modules on the system start up, first we need to run control panel as administrator. then select the module as 'service' in the left of the control panel. – Dexter Aug 25 '14 at 07:08
  • Thank you...would have never known that...I've been using xampp all this time too! – greaterKing Jun 22 '17 at 17:42
  • 1
    Thanks, this was what we needed – Ryan H Apr 25 '20 at 16:27
15

Apache

  1. Run cmd as administrator
  2. Go to the Apache bin directory, for example, C:\xampp\apache\bin
  3. Run: httpd.exe -k install more information
  4. Restart the computer, or run the service manually (from services.msc)

MySQL

  1. Run cmd as administrator
  2. Go to the MySQL bin directory, for example, C:\xampp\mysql\bin
  3. Run: mysqld.exe --install more information
  4. Restart the computer, or run the service manually (from services.msc)
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
bato3
  • 2,695
  • 1
  • 18
  • 26
  • 1
    Perfect answer. Thanks. Just make sure the services are stopped in XAMPP before doing the above items. – SOSidb Nov 12 '17 at 12:18
  • Ended up here for a general search on install Apache service to start at windows boot (not XAMPP specific). I ran "httpd.exe -k install" in a normal cmd (not as administrator), and it worked, but then the serivce doesn't start at boot even if it's set to start automatically. So for me the "Run cmd as administrator" did the trick ! – Larphoid Apr 01 '21 at 10:03
  • I can verify this works. No need to login user, both apache and mysql already running once the system complete boot up (ie show the login menu). Thanks! – GeneCode Mar 14 '22 at 08:36
  • 1
    this should be accepted answer, as well deserves max upvotes. – iWasCloud Jun 22 '22 at 10:46
  • For some reason the intl extension is not being loaded when running apache as a services this way. – Floris Aug 26 '23 at 16:32
9
  1. Window + R
  2. Type services.msc
  3. Search for your WAMP Apache and go to property and select Auto.
  4. Restart your computer.

As a service

You can set this one by:

Going first to your installation directory (in my case it’s c:\xampplite). It could be somewhere else depending on your installation. Have also my full version in c:\x2\xampp. Once your in the installation directory, find xampp-control.exe and click/double-click to launch it.

You should first stop all running instances of your apache2 and mysqld/mysql processes to do this.

Click the checkmark next to Apache and MySQL with the header name service. It will warn you that it’s installing as a service which of course is what we like it to do. Click Yes.

Also do step 5 with MySQL. We’re almost done.

Click StartRun

Type services.msc (it can also be done in the control panel under administrative tools which is a way lot of click than this one). Find the Apache 2 and MySQL services.

Double click each one and set the startup type to Automatic (you will be presented with three options: Automatic, Manual, and Disabled):

  • Automatic – will start it automatically at startup
  • Manual – users will have to start it up manually i.e. by issuing a command like net start apache2
  • Disabled – will disable it.

Be warned though that any change in the services just like the registry can cause your system to stall.

Click the start button to manually start it (just for the session though). At the next restart it’ll be automated.

Do the same with MySQL.

As a startup program

Find xampp_start.exe from your installation directory.

Press Ctrl + C to copy it or right-click the file and hit copy.

Go to C:\Documents and Settings\Administrator\Start Menu\Programs\Startup and right click on it and hit Paste Shortcut.

When you restart it’ll be starting also and you’ll see something like this:

You can stop it by issuing the xampp_stop.exe command in your installation directory.

Also worth mentioning is that if you right click again on the shortcut and hit properties, try to change the run option to minimized. This way the shortcut will be on your taskbar once started.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rahul rajoria
  • 109
  • 1
  • 6
8

One of the latest XAMPP releases (XAMPP for Windows v5.6.11 (PHP 5.6.11) for sure, probably some earlier versions too) does not have the Control Panel with the "Svc" checkbox that allows to install Apache and MySQL as a service.

Go to your XAMPP/Apache directory instead (typically C:/xampp/apache) and run apache_installservice.bat as an administrator. There is also apache_uninstallservice.bat for uninstall.

To run MySQL as a service. Do it the same way - the location is xampp/mysql and batch files are: mysql_installservice.bat for service installation and mysql_uninstallservice.bat for removing the MySQL service.

You can check if they were installed or not by going to services manager window (press Windows + R and type: services.msc) and check if you have Apache service (I had Apache2.4) running and set to startup automatically. The MySQL service name is just: mysql.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mark
  • 1,357
  • 16
  • 30
3

You could copy the XAMPP shortcut into "Local Disk C /users/YourUserName/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Start-up"...

This will make the control panel start up with the computer. Then if you were to select the configuration in the top right hand corner of the control panel you can make Apache and MySQL auto start... This is a quite long-winded get around, but it works for Windows 10.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
2

Copy xampp_start.exe from your XAMPP install directory to C:\Users\YOUR USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

Replace YOUR USERNAME with your username.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
bowman han
  • 1,097
  • 15
  • 25
2

If on your system User Control Account is Off then you can run the XAMPP as Administrator and check the boxes for run as service.

And if on your system User Control Account is On then it may not work. You have go to Configuration files and manually install as a service or run apache_installservice.bat for Apache and mysql_installservice.bat for MySQL at the path

  1. C:\xampp\apache
  2. C:\xampp\mysql

if path is the default path.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Inzimam Tariq IT
  • 6,548
  • 8
  • 42
  • 69
2

Find/search for file "xampp-control.ini" where you installed XAMPP server (e.g., D:\Server or C:\xampp).

Then edit in n the [Autostart] section:

Apache=1
MySQL=1
FileZilla=0
Mercury=0
Tomcat=0

Where 1 = true and 0 = false

That's so simple.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
IshaniNet
  • 153
  • 10
  • The only thing this does is make Apache and MySQL automatically start when the XAMPP Control Panel is started, whereas the OP wanted to have Apache and MySQL autostart when the system starts up. – Tech Expert Wizard Nov 23 '20 at 12:55
0

Open:

C/users/YourUserName/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Start-up

If there is a problem finding the above directory:***

Press Windows + R and write shell:startup. Press Enter. It will move you to the directory.

Drag and drop the XAMPP control panel to the above directory

It will open XAMPP automatically.

If you want to auto start Apache and MySQL, click on config in XAMPP and check the Apache and XAMPP items (if unchecked) and save it. It will start it automatically.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Imad Ullah
  • 929
  • 9
  • 17
0

You can do it via cmd.

For Apache

Open cmd in administrator mode. Change directory to C:/xampp/apache/bin. Run the command as httpd.exe -k install. Your Apache server service will be installed. You can start it from services.

For MySQL

Change directory to C:/xampp/mysql/bin. Run the command as mysqld --install. Your MySQL service will be installed. You can start it from services.

Note: Make sure the selected Apache and MySQL services are set to start automatically.

You're done. There isn't any need to launch the XAMPP control panel

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

Ok, so I've tried using the Xampp Control Panel and choosing from the Config menu to start MySQL did not work. Instead go to C:\xampp\mysql and run a file entitled mysql_installservice and MySQL will automatically run as a Windows service.