WINDOWS8 configuration Homestead and Laravel development environment

Source: Internet
Author: User
Tags ssh access
Preparation Tools

In general, configuring the development environment on Windows is a tough thing to do. And the advent of vagrant is a benefit to our developers. Greatly reduced the complexity of our configuration of new, but although somewhat reduced, but still have to do some. Words do not say much, the following start to get to the point, first of all need something: 1. Windows has installed Git, if not installed, click here 2. Need to install PHP (PHP only, the others do not need, and in the php.ini to open the OpenSSL extension). 3. Composer and vagrant and VirtualBox and a homestead are then required. These are all the software needed to configure the environment, let's go with the environment.

Configuration process

In short, Homestead is a VirtualBox-based Linux virtual machine Laravel The official pre-packaged, installed in this virtual machine a series of software Nginx, PHP 5.6, MySQL, Postgres, Redis, Memcached, the development of enough laravel. This virtual machine can be easily started, destroyed, and rebuilt. Basically don't mess up your existing operating system. The following is simply the installation process:

Composer installation

Composer is a dependency management tool in PHP that can easily manage the range of extensions required in the Laravel development process. is a very important tool. Directly open the download installation package installed on the line, if there is an error, it is estimated that the PHP is not open SSL, re-open the installation can be successful.

Vagrant and VirtualBox Installation

These two are also based on the graphical interface installed, directly installed on the line. It is necessary to note that to use VirtualBox, you need to turn on hardware dummy support (vt-x) and open it in the BIOS.

Configuring virtual Machines

The required software is basically installed, and the next step is to configure the virtual machine. 1. Add the homestead to the VirtualBox and run the following code in the terminal (path is where you place the homestead): shell vagrant box add laravel/homestead path\homestead.box2. Install the Homestead command-line tool: shell composer global require "laravel/homestead=~2.0"In general, there will be an SSL error, this is due to our special national conditions, you know, the solution is to use the domestic mirror, according to the way here to add the domestic mirror inside the Composer.json, execute the above code again, you can successfully complete the installation.

  • The shell homestead init configuration file that generated the C:\users\.homestead,homestead after the initialization of the homestead executes is inside.

  • Modify Homestead.yaml

    "' Shell

    ip: "192.168.10.10"memory: 2048cpus: 2authorize: ~/.ssh/id_rsa.pubkeys:    - ~/.ssh/id_rsafolders:    - map: ~/LaravelWorkspace      to: /home/vagrant/Codesites:    - map: homestead.app      to: /home/vagrant/Code/laravel/public          hhvm: truedatabases:    - homesteadvariables:    - key: APP_ENV      value: local

    The Laravelworkspace is a code-sharing area where changes are immediately reflected in the virtual machine. The other is some of the site and database configuration, specific details you can go to Laravel's official website to see detailed details of the introduction. Then the SSH key above is to be generated by Gitbash, as follows:

    shell ssh-keygen -t rsa -C "your@email.com"The site needs to add the following configuration to the Windows C:\Windows\System32\drivers\etc\hosts file:shell 192.168.10.10 homestead.app

  • Start a virtual machine

    shell homestead upAfter executing the above code for a period of time, you should be able to see that the virtual machine is up and then http://homestead.app:8000 go through or 192.168.10.10 visit the homepage of your Laravel project.

  • Homestead ssh problem

    Above describes the WINDOWS8 configuration homestead and Laravel development environment, including the aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.