2

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.

karel
  • 5,489
  • 46
  • 45
  • 50
Inversemaha
  • 61
  • 1
  • 10

3 Answers3

4

To autostart XAMPP modules is really simple. Follow the steps:

STEP 1: enter image description here

STEP 2: Enable apache and mysql enter image description here

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.

mindmaster
  • 1,828
  • 12
  • 22
2

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:

  1. 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".
  1. “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.

  2. Restart your Apache server and browse “ship.com”.
Inversemaha
  • 61
  • 1
  • 10
0

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:

  1. Open the httpd-vhosts.conf file located in the XAMPP\apache\conf\extra directory.

  2. 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>
  1. Save the httpd-vhosts.conf file and restart the Apache server in XAMPP.

  2. 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
  1. Save the hosts file and close it. if you are not able to save, plea

  2. 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.

Narsimhulu
  • 77
  • 8