【发布时间】:2026-01-07 10:20:03
【问题描述】:
我正在尝试在我的 KnownHost VPS 上安装 Composer。当我运行这个命令时:
curl -sS https://getcomposer.org/installer | php
我收到此错误消息:
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The phar extension is missing.
Install it or recompile php without --disable-phar
如何安装 phar 扩展?我在我的 VPS 上运行 PHP 5.4.22。
【问题讨论】:
-
试试这个:
curl -sS https://getcomposer.org/installer | php -d detect_unicode=Off. -
您使用的是什么操作系统?
-
@AmalMurali 是的,但是 *nix 的风格对于安装/启用 phar 扩展的最佳方式有很大的不同。
-
我认为vps运行的是centos 6
-
你解决过这个问题吗?我在 DreamHost 也有类似的情况。
标签: php linux shell composer-php