问题描述
是否可以在无法使用 ssh 仅 ftp 访问的廉价网络空间上运行 composer?
Is it possible to run composer on a cheap webspace that can't be accessed using ssh, only ftp?
运行 system('php composer.phar install');
理论上应该可以工作 - 这是推荐的方法吗?
Running system('php composer.phar install');
should work in theory - is that the recommended method?
推荐答案
我认为最好的方法,正如之前评论中所建议的,是在能够执行此操作的本地系统上执行 composer 步骤,然后上传通过 FTP 获取结果.
I think the best way, as suggested in the comments before, is to execute the composer step on a local system that is able to do it, and then upload the result via FTP.
Composer 具有一些(可能是可选的)软件依赖项,这些依赖项很可能在您的网络空间中不可用.例如,它需要 Git 和 SVN 客户端软件,以防您要安装的项目引用此类依赖项.
Composer has some (probably optional) software dependencies that most likely will not be available on your webspace. For example it needs the Git and SVN client software in case the project you are about to install references such dependencies.
另一件事是从 Github(或其他任何地方)下载可能会失败.或者触发 API 限制并要求登录.
Another thing is that downloading from Github (or anywhere else) can fail. Or trigger the API limit and ask for a login.
您真的想收集所有软件并知道它可以工作,而不是希望它能够在远程很好地执行.
You'd really want to collect all the software and know that it worked instead of hoping it will execute well remotely.
这篇关于在没有 ssh 访问服务器的情况下使用 Composer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!