mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2026-06-16 01:02:14 +08:00
fix: 解决 PHP 5.5.38 安装 composer 失败的问题
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The latest mirror's composer version only support for PHP 5.6.0
|
||||
# The latest mirror's composer version only support for PHP 7.2.5
|
||||
# And if your PHP version is lesser than that, will be download supported version.
|
||||
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '5.5.0', '>');")
|
||||
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '7.2.5', '>');")
|
||||
|
||||
if [ "$supportLatest" -eq "1" ]; then
|
||||
curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
|
||||
&& chmod +x /usr/bin/composer
|
||||
else
|
||||
curl -o /tmp/composer-setup.php https://getcomposer.org/installer \
|
||||
&& php /tmp/composer-setup.php --install-dir=/tmp \
|
||||
&& mv /tmp/composer.phar /usr/bin/composer \
|
||||
curl -ksS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --disable-tls \
|
||||
&& chmod +x /usr/bin/composer \
|
||||
&& rm -rf /tmp/composer-setup.php
|
||||
fi
|
||||
Reference in New Issue
Block a user