I’ve been working on this Vagrant lately. It’s not that difficult, but it’s mainly about the configuration of the computer environment at work and home. I’m not satisfied with the Vagrant Box I made in the past, but I haven’t used Laravel/Homestead, so I’ll just build a comprehensive one this time.

PHP 7.0

Ha ha da.

The problem is that the global installation is not flexible enough, so I can only install it by project. In this case, I need to specify php.exe for installing composer (if I install it by composer -setup.exe), I can only install PHP first.

  • Php.net download the Windows version of PHP and drop it intoD:\\php
  • Download the composer
    • The option is to download Composer-setup.exe
    • You can also download the Phar file directly

When you’re done, follow the Per Project Installation section of the Homestead Installation tutorial:

  • Create a project catalogD:\\projects\\homesteadapp
  • Command line accessD:\\projects\\homesteadappI’m usinggit bash
  • Execute the commands in sequence:composer require laravel/homestead --dev -> vendor\\bin\\homestead makeThis produces a standard Homestead Vagrant configuration, followed by routine operations such as Vagrant Up.

Everything seems to be going well

It’s not.

There are a number of things to note:

  1. Windows10 requires vcruntime140.dll
  2. To install Composer-setup.exe, PHP needs openSSL enabled
  3. Not just uncomment open_ssl in php.ini, comment extension_dir = ext as well, otherwise PHP will be in thec:\\php\\phpLook for the DLL file, but it’s not there. How do I know?Look at this article

Common sense: Modify composer mirroring library to domestic

Bonus: For well-known reasons, vagrant Box Add BoxName is hardly feasible. Here are two Homestead Boxes I downloaded:

  • Laravel/Homestead Baidu web disk password: su3L
  • laravel/homestead-7 Baidu cloudPassword: RI82PHP 7.0 inside

Feel is a running account, but clearly toss me for a long time…

Don’t forget to add both PHP and Composer to the environment variables.