与laravel homestead流浪的份额 [英] vagrant share with laravel homestead

查看:55
本文介绍了与laravel homestead流浪的份额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,那就是要让流浪者分享与laravel宅基地流浪者盒子一起使用.我的homestead.yaml文件如下所示:

I'm running into an issue getting vagrant share to work in conjunction with the laravel homestead vagrant box. My homestead.yaml file looks like:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1

authorize: /Users/me/.ssh/id_rsa.pub

keys:
    - /Users/me/.ssh/id_rsa

folders:
    - map: /Users/me/Projects/laravel
      to: /home/vagrant/laravel

sites:
    - map: laravel.app
      to: /home/vagrant/laravel/public

variables:
    - key: APP_ENV
      value: local

当我点击 http://laravel.app:8000 时-一切正常.当我启动vagrant share时,生成的URL返回错误No input file specified.

When I hit http://laravel.app:8000 - everything works fine. When I start up vagrant share the URL that's generated returns the error No input file specified.

我很困惑.在Google上搜索了几个小时并没有找到解决方案.我敢肯定这只是一些基本的配置,而且我并没有连接点.任何指针,将不胜感激.谢谢!

I'm stumped. Searching Google for hours hasn't resulted in a solution. I'm sure it's just some basic configuration thing and I'm not connecting the dots. Any pointers would be appreciated. Thanks!

推荐答案

有一种解决方案,无需在您的家庭VM上做任何事情.

There's a solution without having to do anything on your homestead VM.

您可以安装一个名为 ngrok 的程序,该程序与vagrant share相似,但在与多个宅基地用途.您需要注册一个帐户,但基本用法是免费的.

You can install a program called ngrok which does a similar thing to vagrant share but works better with the multiple sites that Homestead uses. You will need to sign up for an account but basic usage is free.

运行:ngrok http -host-header=rewrite your-local-site.app:80

(其中your-local-site.app是Homestead.yaml文件中的map指令所使用的内容)

(Where your-local-site.app is what's used for the map directive in your Homestead.yaml file)

然后,您的网站将在ngrok为您提供的URL上全局可用.

Then your site will be available globally on the url that ngrok gives you.

这篇关于与laravel homestead流浪的份额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆