[LINUX] Build a local development environment for Laravel6.X on Mac

Work log until the top page of the Laravel6 project installed in the VM is displayed with a browser It seems that you can easily do it with Homestead provided by the head family.

Various installations

Install VirtualBox

https://www.virtualbox.org/wiki/Downloads

Install Vagrant

https://www.vagrantup.com/downloads.html

Install Homestead Vagrant Box

This time, Homestead and the shared folder (described later) will be installed in the user's Home.

$ cd ~
$ vagrant box add laravel/homestead

Homestead installation

$ git clone https://github.com/laravel/homestead.git ~/Homestead

$ cd ~/Homestead

$ bash init.sh

Modify the Homestead config file

$ vi Homestead.yaml

The items ʻauthorize and keys` are omitted because they only describe the public and private keys.

Partially rewritten with the following contents

item name
Mac -Shared folder name between VMs tukanpo-proj
Laravel project name tukanpo
DB name tukanpo
folders:
    - map: ~/tukanpo-proj
      to: /home/vagrant/tukanpo-proj

sites:
    - map: tukanpo.test
      to: /home/vagrant/tukanpo-proj/tukanpo/public

databases:
    - tukanpo

Create shared folder on mac

$ mkdir ~/tukanpo-proj
$ chmod 755 ~/tukanpo-proj

Launch an instance of Vagrant

$ vagrant up

Connect to Vagrant

$ vagrant ssh
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-72-generic x86_64)

Thanks for using
 _                               _                 _
| |                             | |               | |
| |__   ___  _ __ ___   ___  ___| |_ ___  __ _  __| |
| '_ \ / _ \| '_ ` _ \ / _ \/ __| __/ _ \/ _` |/ _` |
| | | | (_) | | | | | |  __/\__ \ ||  __/ (_| | (_| |
|_| |_|\___/|_| |_| |_|\___||___/\__\___|\__,_|\__,_|

* Homestead v10.0.0 released
* Settler v9.1.0 released

0 packages can be updated.
0 updates are security updates.


vagrant@homestead:~$

Laravel project generation

vagrant@homestead:~$ cd tukanpo-proj
vagrant@homestead:~/tukanpo-proj$ composer create-project --prefer-dist laravel/laravel tukanpo

Virtual server host name resolution

Add the following to hosts on mac

$ sudo vi /etc/hosts
192.168.10.10   tukanpo.test

Verification

http://tukanpo.test

When you cannot connect

I was addicted to the folders and sites misconfigurations in Homestead.yaml.

Note that if you modify the sites property of Homestead.yaml, it will not be updated unless you execute the following command.

$ vagrant reload --provision

How to check the version

Laravel

vagrant@homestead:~/tukanpo-proj/tukanpo$ php artisan -V
Laravel Framework 6.6.2
```

 Homestead

```
$ vi ~/Homestead/bin/homestead
```

 This line

```php
$app = new Symfony\Component\Console\Application('Laravel Homestead', '10.0.1');
```

## Save here

 Create a remote repository in advance

```
$ cd ~/tukanpo-proj
$ git init
$ git add .
$ git commit
$ git remote add origin [email protected]:tukanpo/tukanpo-proj.git
$ git fetch
$ git merge --allow-unrelated-histories origin/master
```

## reference

https://qiita.com/oreo3@github/items/1705b133e00019800ff6


Recommended Posts

Build a local development environment for Laravel6.X on Mac
Build a Python development environment on your Mac
Build a Kubernetes environment for development on Ubuntu
Build a Django development environment using pyenv-virtualenv on Mac
Build a Python development environment on Mac OS X
How to build a development environment for TensorFlow (1.0.0) (Mac)
Build a local development environment for Lambda + Python using Serverless Framework
Build a LAMP environment on your local Docker
Build a Python environment on Mac (Mountain Lion)
Build a mruby development environment for ESP32 (Linux)
Build a Python development environment on Raspberry Pi
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
Build a machine learning Python environment on Mac OS
Build a GVim-based Python development environment on Windows 10 (1) Installation
Build a Python environment on your Mac using pyenv
Build a Python development environment using pyenv on MacOS
Build a local development environment with WSL + Docker Desktop for Windows + docker-lambda + Python
Building a Python environment on Mac
Create a Python environment on Mac (2017/4)
Build a python3 environment on CentOS7
Build a machine learning environment on mac (pyenv, deeplearning, opencv)
[Memo] Build a development environment for Django + Nuxt.js with Docker
Build a python data analysis environment on Mac (El Capitan)
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
Build a Python extension for E-Cell 4 on Mac OSX (Yosemite)
Create a virtual environment for python on mac [Very easy]
Build a python environment on CentOS 7.7 for your home server
Addition of local development environment on MacOS
Easily build a development environment with Laragon
Build a python environment on MacOS (Catallina)
Build a Python environment on your Mac with Anaconda and PyCharm
Create a python environment on your Mac
[Mac] Building a virtual environment for Python
I installed Kivy on a Mac environment
Build Python environment with Anaconda on Mac
Prepare the development environment for keyhac for Mac
Build a Python + OpenCV environment on Cloud9
Building a Python development environment for AI development
Creating a development environment for machine learning
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
Build a version control environment for Python, Ruby, Perl, Node.js on UNIX
I tried to build a Mac Python development environment with pythonz + direnv
Build a local server with a single command [Mac]
Build a C language development environment with a container
Build a WardPress environment on AWS with pulumi
Simply build a Python 3 execution environment on Windows
Build a Django environment on Raspberry Pi (MySQL)
Build a python environment with ansible on centos6
[Python] Build a Django development environment with Docker
I created a Dockerfile for Django's development environment
Building an environment for matplotlib + cartopy on Mac
Build a Django development environment with Doker Toolbox
Set up a Python development environment on Marvericks
Build a Minecraft plugin development environment in Eclipse
Create a Python virtual development environment on Windows
[Note] How to create a Mac development environment
I want to create a nice Python development environment for my new Mac
How to build an environment for using multiple versions of Python on Mac
Build a TensorFlow development environment on Amazon EC2 with command copy and paste
Set up a development environment for natural language processing
Install Python3 on Mac and build environment [Definitive Edition]