I need to setup my Laravel application and XAMPP locally in Windows so that it can be accessed from multiple PCs in my local network. I've set it up successfully, but now I want to autostart my Laravel application and XAMPP when Windows is started.
3 Answers
To autostart XAMPP modules is really simple. Follow the steps:
STEP 2: Enable apache and mysql
RESTART THE XAMPP APPLICATION and you will see that will initialize automatically on your pc startup.
To autostart the laravel project, i think by adding your editor in the task manager, start up applications, will automatically open your editor with the project.

- 1,828
- 12
- 22
-
Don't forget to mark it as a valid question so that we are able to help other people! – mindmaster Mar 11 '19 at 09:51
I've solved the problem. I am using XAMPP under Windows OS. These are the steps on how to autustart Laravel Project on localhost. First you have to Enable virtual host configuration like under those steps:
- Set virtual host in "C:\xampp\apache\conf\extra\httpd-vhosts.conf".
The add a new virtual host (e.g: ship.com)
# Virtual host of ship.com
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs\ship-management-master\public"
ServerAdmin ship.com
<Directory "C:\xampp\htdocs\ship-management-master\public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Now have to add your Laravel Project public folder path into "DocumentRoot" and "Directory".
“C:\Windows\System32\drivers\etc\hosts” file, enter host entry.
a) Go to Start Menu, Right-Click on Notepad++ page and choose Run as Administrator.
b) Then got to
“File->Open->C:\Windows\System32\drivers\etc\hosts”
uncomment " 127.0.0.1 ship.com"
and replace "localhost" name to your virtual host name aslike " 127.0.0.1 ship.com"
c) If you couldn’t see the files, change File Type : All files and enter host entry in host file.- Restart your Apache server and browse “ship.com”.

- 61
- 1
- 10
You can add more than one application/projects in xampp, for that please follow below steps
To add your Laravel projects mobile-api and web-admin to a VirtualHost in XAMPP, you can follow these steps:
Open the httpd-vhosts.conf file located in the XAMPP\apache\conf\extra directory.
Add a new VirtualHost block for each Laravel project. Each VirtualHost block should have a unique ServerName and DocumentRoot. The VirtualHost block should look something like this:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mobile-api/public"
ServerName mobile-api.local
ErrorLog "logs/mobile-api-error.log"
CustomLog "logs/mobile-api-access.log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/web-admin/public"
ServerName web-admin.local
ErrorLog "logs/web-admin-error.log"
CustomLog "logs/web-admin-access.log" common
</VirtualHost>
Save the httpd-vhosts.conf file and restart the Apache server in XAMPP.
Open the hosts file located in C:\Windows\System32\drivers\etc directory and add a new entry for each Laravel project. The entries should look like this:
127.0.0.1 mobile-api.local
127.0.0.1 web-admin.local
Save the hosts file and close it. if you are not able to save, plea
Open your web browser and go to http://mobile-api.local or http://web-admin.local to access your Laravel projects.
Note: Make sure that each Laravel project is properly configured to run on the localhost environment and that all required dependencies are installed.

- 77
- 8