How to automatically start Apache and MySQL using XAMPP in Windows?

Hello, I want to install a Laravel script on my client’s computer. The client uses a windows computer, so I decided to use XAMPP. Everything is working perfectly, but the client is too lazy to start Apache and MySQL every time he opens the computer. So I am looking for a solution where, when the customer starts his computer, the XAMPP will auto-start, and Apache and MySQL will start automatically.

Is there a way I can make it auto-start Apache and MySQL?

Start the control panel using “Run as administrator”, and then you will see some cross buttons next to Apache and MySQL. From there, you install Apache and MySQL as a service that automatically starts when the computer restarts.

xampp-apache-mysql-install-as-service.md.jpg

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
  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
  4. Restart the computer, or run the service manually

Make sure the services are stopped in XAMPP before doing the above items.

AutoRun XAMPP

  1. Open RUN → Search or Use: window + R
  2. Copy, Paste and Run : Shell:common startup
  3. A Folder will open
  4. Create the Shortcut of XAMPP, then copy it to that folder
  5. Restart the Computer

AutoRun Apache & Mysql

  1. Open XAMPP [Run as administrator]
  2. Click on the Config button (upper right)
  3. Check Apache and MySql under Autostart of Modules
  4. Save

autostart-xampp-apache-mysql.md.jpg