Home > Backend Development > PHP Tutorial > laravel-homestead environment construction

laravel-homestead environment construction

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-29 09:12:49
Original
948 people have browsed it

composer installation

  • Use curl command to download: culr -sS https://getcomposer.org/installer | php
  • Use php command to download: php -r "readfile('https: //getcomposer.org/installer');" | php
  • or manually download composer.phar

After you download, you need to configure environment variables so that you can perform global domain operations in any path mv composer.phar /user/local/bin/composer

Install virtualboxvirtual machine and vagrantmanagement tools

Before starting your Homestead environment, you must first install

VirtualBox and Vagrant. Both sets of software provide easy-to-use visual installation programs on each platform.

Add Vagrantbox (the box here is the homestead package, click Vagrant box to get more image boxes)

After VirtualBox / VMware and Vagrant are installed, you can run the following in the terminal command to install the 'laravel/homestead' package into your Vagrant installation. Downloading the package package will take you a while, and the length of time will be determined by your network speed:

vagrant box add laravel/homestead

If the network is normal, wait slowly for downloading and then add it, here due to the network Because I tried many times but failed, I finally copied the download link directly

https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.7/providers/virtualbox.box download Save to /path/tovirtualbox.box and then install the Homestead command line cli tool via

vagrant box add laravel /homestead /path/to/virtualbox.box

The box is added to After Vagrant is installed in the directory, install the Homestead command line tool through Composer's global command:

composer global

require

"laravel/homestead=~2.0"Homestead configuration and initialization

installation After using the Homestead command line tool, execute init to create the Homestead.yaml configuration file

homestead init

The generated Homestead.yaml file will be placed in the ~/.homestead directory. If you are using a Mac or Linux operating system, you can also edit the Homestead.yaml file by executing the homestead edit command:

homestead editStart the Vagrant box

Edit "Homestead.yaml" according to the actual situation file, you can execute the

homestead up

command in the Homestead directory on the terminal. Vagrant will start the virtual machine and automatically configure the shared directory and Nginx site! Don’t forget to add the “domain” of your Nginx site to the hosts

file on your machine! The

hosts file will redirect requests to the local domain to the Homestead environment. The above introduces the laravel-homestead environment construction, including the require content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template