Home >Backend Development >PHP Tutorial >windows8 configure homestead and laravel development environment
shell vagrant box add laravel/homestead pathhomestead.box
2. Install the homestead command line tool: shell
composer global require "laravel/homestead=~2.0"
Usually there will be an SSL error here. This is caused by our special national conditions. You know, the solution is to use domestic mirrors and follow the method here in composer. Add the domestic image to json and execute the above code again to successfully complete the installation. Initialize homestead shell homestead init
After execution, C:Users.homestead is generated, and the homestead configuration file is inside.
Modify Homestead.yaml
```shell
<code>ip: "192.168.10.10" memory: 2048 cpus: 2 authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: ~/LaravelWorkspace to: /home/vagrant/Code sites: - map: homestead.app to: /home/vagrant/Code/laravel/public hhvm: true databases: - homestead variables: - key: APP_ENV value: local </code>
``` LaravelWorkspace is a code sharing area, and the modifications made here can be immediately reflected in the virtual machine. Others include site and database configurations. For specific details, you can go to laravel's official website for detailed introduction. Then the above ssh key must be generated through gitbash, as follows:
shell ssh-keygen -t rsa -C "your@email.com"
That site needs to add the following configuration to the C:WindowsSystem32driversetchosts file in Windows : shell
192.168.10.10 homestead.app
Start the virtual machine
shell homestead up
After executing the above code for a while, you should be able to see the virtual machine being started, and then use http://homestead.app :8000
or 192.168.10.10
to visit the homepage of your laravel project.
The above introduces the configuration of homestead and laravel development environment in Windows 8, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.