PHP composer 安装 thinkphp 报错问题, 求助(急)

2020-10-28 10:55:58 +08:00
 edk24

服务器以前有个 php5.4, 后面加了个 php7.3

用 composer 自动定位 5.4, 导致我 tp5.1 无法安装依赖, 现在用网上这个方式安装。 其他都 ok 了。 tp 却安装不上了

着急。。。

[root@yunguizhou star]# /usr/local/php/bin/php composer.phar install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 1 install, 0 updates, 0 removals
  - Downloading topthink/framework (v5.1.40)
  - Installing topthink/framework (v5.1.40): Extracting archive
    Failed to extract topthink/framework: (9) unzip -qq  '/home/wwwroot/star/vendor/composer/tmp-7ea691416e557dbb8cb8858815b4c4ef' -d '/home/wwwroot/star/vendor/composer/bd3e9c7b'
                                                                                                                                                                                                                     
unzip:  cannot find or open /home/wwwroot/star/vendor/composer/tmp-7ea691416e557dbb8cb8858815b4c4ef.                                                                                                                 
                                                                                                                                                                                                                     
    This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
    See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
Package endroid/qrcode is abandoned, you should avoid using it. Use endroid/qr-code instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Generating autoload files
10 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

4391 次点击
所在节点    PHP
31 条回复
Mitt
2020-10-28 21:21:13 +08:00
@Seanfuck #20 所以说这是你的问题,不是技术的问题
emeab
2020-10-28 21:36:40 +08:00
@Seanfuck php 不是编译型语言 为什么包要编译成二进制. 你用包都不看源码和实现的吗
emeab
2020-10-28 21:41:43 +08:00
@Seanfuck tp6.0 引用了 7 个包。 如果不用 composer 还要处理版本问题。
Seanfuck
2020-10-28 22:05:57 +08:00
@emeab 那用低版本好了
Seanfuck
2020-10-28 22:07:05 +08:00
@emeab 不是这个意思……
Seanfuck
2020-10-28 22:08:14 +08:00
@Mitt 那行,我就不再回复你了。
dvaknheo
2020-10-29 10:21:07 +08:00
@Mitt 线上 install 是错误的用法。发布的时候直接复制做好的包就够了。
composer 的离线功能做得不够好。 没有完全离线的命令.
甚至有人都不知道可以使用本地第三方作为包。
dvaknheo
2020-10-29 10:27:25 +08:00
php5 时代的框架,没有一个不被魔改的
composer 结束了系统库被魔改这一种烂现象。
dvaknheo
2020-10-29 10:30:20 +08:00
@emeab 才 7 个包的框架能实现什么功能,laravel 用 101 第三方个包,带动了产业大发展 (手动狗头)
RickyC
2020-10-29 13:00:40 +08:00
https://blog.class4ever.com/2712.html

这是一个修改 composer 对应 php 版本的方法, 在宝塔面板环境实操过

可以参考
edk24
2020-10-29 14:41:14 +08:00
感谢大家的回复,现在问题是总结出来了,无法下载是因为我用了最新的 composer2,tp 的包还没有兼容这个新版本改动; 切换回旧版本就可以了。

关于用 composer 的问题, 我个人是觉得很好用, 很方便, 要用什么东西直接用, 不需要这里引入一个文件哪里映入问题, 服务器上下载包用镜像就可以了。 这次是出问题在 composer 新版特性上;

优点是专注敲业务, 不需要管很多东西的实现,只需要引用就可以了,并且 git 是自动忽略依赖文件的,所以 git 仓库里只有业务代码, 没有多余的乱七八糟的文件。

这个是我个人的想法,
@Seanfuck
@skymei
@agdhole
@Mitt
@hbolive
@JaguarJack
@ben1024
@hsk9044
@emeab
@dvaknheo
@RickyC

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/719328

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX