Hug*_*葛修远 14
问题是,虽然box: laravel/homestead-7设置正确Homestead.yaml,但作曲家依赖laravel/homestead仍然使用php-5版本.这意味着Vagrant的配置脚本vendor/laravel/homestead是php-5而不是php-7 的配置脚本.
这可以通过使用laravel/homestead作曲家依赖的特定分支来解决.
在composer.json,为以下内容添加自定义存储库laravel/homestead:
"repositories": [
{
"type": "git",
"url": "https://github.com/laravel/homestead"
}
]
Run Code Online (Sandbox Code Playgroud)
并要求php-7分支专门用于laravel/homestead:
"require-dev": {
"laravel/homestead": "dev-php-7"
}
Run Code Online (Sandbox Code Playgroud)
然后composer update重新配置Vagrant框将解决问题.
UPDATE
laravel/homestead现在默认情况下为PHP 7.0,旧php-7分支不再存在.要解决此问题,您只需更新到最新版本的laravel/homesteadvia composer.json.
为了快速解决问题,我发现laracasts的这个答案非常有帮助:
cd ~/Homestead && git pull && vagrant destroy && vagrant box update && vagrant up
Run Code Online (Sandbox Code Playgroud)