在没有互联网连接的情况下创建laravel应用 [英] Creating laravel apps without internet connection

查看:101
本文介绍了在没有互联网连接的情况下创建laravel应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

laravel 5.1是否可以在没有互联网连接的情况下工作? 我喜欢创建一个laravel新应用 当我执行laravel新测试(通过Internet连接)时,它运行良好; 但是当我在没有互联网连接的同一个目录(新的anotherName)中执行类似的命令时,它不起作用,并且显示嵌套错误消息

Does laravel 5.1 work without internet connection? I like to create a laravel new application when i execute laravel new test (with intenet connection) it works well; but when i execute similar command in the same directory (new anotherName) without internet connection it doesn't work and the nest error message is shown

  [GuzzleHttp\Exception\RequestException]                                      
  Error creating resource. [url] http://cabinet.laravel.com/latest.zip [type]  
   2 [message] fopen(http://cabinet.laravel.com/latest.zip): failed to open s  
  tream: php_network_getaddresses: getaddrinfo failed: Name or service not kn  
  own [file] /home/<Myname>/.composer/vendor/guzzlehttp/guzzle/src/Adapter/Str  
  eamAdapter.php [line] 367 

是否有解决方案,因为我无法始终在线工作?

Is there a solution because i can't work online always?

推荐答案

使用laravel安装程序时,它将从服务器获取最新版本.一种解决方案是初始化Laravel项目,然后将其添加到git版本控制中,然后在脱机时将项目检出到新文件夹中.您必须手动选择一个新的应用程序密钥(我认为).脱机时,您也将无法composer requirenpm install任何新软件包.

When you use the laravel installer it fetches the latest version from the server. One solution would be to initialise a Laravel project, then add it to git version control and then when offline checkout the project to a new folder. You'd have to manually choose a new app key (I think). You will also not be able to composer require or npm install any new packages while offline.

创建它后,尽管它应该可以离线运行(除非您的视图是从引导程序或jQuery CDN采购资产).

Once you have created it though it should run offline (unless your views are sourcing assets from, say, bootstrap or jQuery CDNs).

这篇关于在没有互联网连接的情况下创建laravel应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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