使用Composer进行Symfony离线安装 [英] Symfony offline installation with composer

查看:260
本文介绍了使用Composer进行Symfony离线安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在服务器上安装Symfony ,该服务器没有与互联网的连接.我在服务器上复制了作曲家,但是当我尝试安装它时,出现此错误

I'm trying to install Symfony on a server, which has no connection to the internet. I copied composer on the server but when i try to install it i get this error

连接错误[ERR_CONNECTION]:无法连接到getcomposer.org

在没有有效连接到互联网的情况下,有没有可能安装symfony的方法?例如下载框架,将其放在服务器上,然后离线运行作曲家?还是它具有过多的依赖关系(将包含在内)?

Is there any possible way to install symfony without active connection to the internet; like download the framework, put it on the server and then run the composer offline? Or does it have too many dependencies, which would be included?

我已经用谷歌搜索,但是找不到令人满意的解决方案.

I've already googled but couldn't find a satisfying solution.

推荐答案

要做

composer install -o

安装.然后进行所有准备工作,例如在prod/dev建立资产中清除缓存并将其转储

to install. Then do all preparations like clear cache in prod/dev build assets and dump them

   php app/console cache:clear && php app/console cache:clear -e prod --no-debug
   php app/console assetic:dump -e prod --no-debug
   php app/console assets:install web --symlink --relative

然后将您的项目推送/ftp到服务器.我强烈推荐您参加比赛

then push/ftp your project to a server. I highly recomend you to run

composer dumpautoload -o

为了更新服务器上的自动下载文件

您也可以(应该)运行symfony的安装后脚本(在转储自动加载后),以便在服务器上编辑/更新您的parameters.yml,因为db-access,mailer_transport可能与您的dev-机器

You could (should) also run a symfony's after-install script (after dumping autoload) in order to edit/update your parameters.yml on the Server, since db-access, mailer_transport will be probably different than on your dev-machine

composer run-script post-install-cmd
php app/console cache:clear -e prod --no-debug

然后运行

php/console list

如果您将获得所有可用命令的列表=>您的symfony应用已成功安装并运行

if you'll get a list of all available commands => your symfony app was successfully installed and runs

这篇关于使用Composer进行Symfony离线安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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