Installing Laravel Using Homestead

Software instlations on system

  • virtualbox
  • vagrant
  • php
  • composer
  • git
  • vscode
vagrant box add laravel/homestead
git clone https://github.com/laravel/homestead.git ~/Homestead
cd ~/Homestead
git checkout release
bash init.sh
code Homestead.yml

Edit the opened file with the help of this

Create New Project of Laravel

composer create-project --prefer-dist laravel/laravel testing

Create ssh Key

ssh-keygen -t rsa -C "ahmadkakarr@gmail.com"

ssh into Vagrant

vagrant ssh

Script for Installing phpmyadmin

curl -sS https://raw.githubusercontent.com/grrnikos/pma/master/pma.sh | sh

Credentials for phpmyadmin

user name = root

password = secret

Add Host names for projects

sudo nano /etc/hosts
192.168.10.10   project1.test
192.168.10.10   testing.test
192.168.10.10   phpmyadmin.com

Vagrant Commands

Start Homestead Machine

vagrant up

Anychange in Homestead.yml file run the following command

vagrant reload --provision

vagrant status

The VM is running. To stop this VM, you can run vagrant halt to shut it down forcefully, or you can run vagrant suspend to simply suspend the virtual machine. In either case, to restart it again, simply run vagrant up.

vagrant global-status
vagrant destroy 1a2b3c4d

Tips

  1. When vagrant machine is not shutdown and computer restarted run the following…
    vagrant reload --provision
    

Errors

sudo nano /etc/nfsmount.conf

Find the section with # Protocol Version [2,3,4]. And look for # Defaultvers= line.

Now uncomment the Defaultvers line and set it to 3 like below.

Next