composer installation
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 upcommand 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! Thehosts 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.