首页 技术 正文
技术 2022年11月11日
0 收藏 411 点赞 4,781 浏览 3386 个字

一句话脚本

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

记得要翻墙哦。

或者下面代码保存成.sh ,代码从http://php-osx.liip.ch/install.sh文件中拷贝的。

#!/bin/bash# package type (subfolder in packager)# default version to install
DEFAULT=5.6if [ -z $1 ]; then
TYPE=$DEFAULT
else
TYPE=$1
fiif [[ $TYPE != "force" ]]; then
OS_VERSION=`sw_vers -productVersion | egrep --color=never -o '10\.[0-9]+'`
if [[ $OS_VERSION == "10.13" ]]; then
echo "****"
echo "[WARNING]"
echo "Detected macOS High Sierra 10.13. As this is quite new, there may be issues still. Your mileage may vary."
echo "****"
sleep 2
elif [[ $OS_VERSION == "10.12" ]]; then
echo "Detected macOS Sierra 10.12. All ok."
elif [[ $OS_VERSION == "10.11" ]]; then
echo "Detected OS X El Capitan 10.11. All ok."
elif [[ $OS_VERSION == "10.10" ]]; then
echo "Detected OS X Yosemite 10.10. All ok."
elif [[ $OS_VERSION == "10.9" ]]; then
echo "Detected OS X Mavericks 10.9 All ok."
elif [[ $OS_VERSION == "10.8" ]]; then
echo "Detected OS X Mountain Lion 10.8 All ok."
elif [[ $OS_VERSION == "10.7" ]]; then
echo "Detected OS X Lion 10.7. All ok."
elif [[ $OS_VERSION == "10.6" ]]; then
echo "Detected OS X Snow Leopard 10.6 All ok."
else
echo "****"
echo "Your version of OS X ($OS_VERSION) is not supported, you need at least 10.6"
echo "Stopping installation..."
echo "If you think that's wrong, try"
echo "****"
echo "curl -o install.sh -s https://php-osx.liip.ch/install.sh | bash install.sh force"
echo "****"
exit 2
fi
if [[ -f /usr/sbin/sysctl ]]; then
SYSCTL="/usr/sbin/sysctl"
elif [[ -f /sbin/sysctl ]]; then
SYSCTL="/sbin/sysctl"
else
SYSCTL="sysctl"
fiHAS64BIT=`$SYSCTL -n hw.cpu64bit_capable 2> /dev/null`
if [[ $HAS64BIT != 1 ]]; then
echo "****"
echo "ERROR! 32 BIT NOT SUPPORTED!"
echo "****"
echo "No 64bit capable system found. Your hardware is too old."
echo "We don't support that (yet). Patches are welcome ;)"
echo "If you think that's wrong, try"
echo "****"
echo "curl -o install.sh -s https://php-osx.liip.ch/install.sh | bash install.sh force"
echo "****"
exit 1
fi
fiif [[ $TYPE = "force" ]]; then
if [ -z $2 ]; then
TYPE=$DEFAULT
else
TYPE=$2
fi
fiif [[ $OS_VERSION = "10.8" ]] || [[ $OS_VERSION = "10.9" ]]; then
if [[ $TYPE = "5.4" ]]; then
TYPE=5.4-10.8
elif [[ $TYPE = "5.5" ]]; then
TYPE=5.5-10.8
elif [[ $TYPE = "5.6" ]]; then
TYPE=5.6-10.8
elif [[ $TYPE = "5.3" ]]; then
TYPE=5.3-10.8
fi
fi# 10.11 & 10.12 should be compatible with 10.10 versions for now.
# See https://github.com/liip/build-entropy-php/issues/16 for more
if [[ $OS_VERSION = "10.11" ]] || [[ $OS_VERSION = "10.12" ]] || [[ $OS_VERSION = "10.13" ]] || [[ $OS_VERSION = "10.10" ]]; then
if [[ $TYPE = "5.4" ]]; then
TYPE=5.4-10.10
elif [[ $TYPE = "5.5" ]]; then
TYPE=5.5-10.10
elif [[ $TYPE = "5.6" ]]; then
TYPE=5.6-10.10
elif [[ $TYPE = "7.0" ]]; then
TYPE=7.0-10.10
elif [[ $TYPE = "7.1" ]]; then
TYPE=7.1-10.10
elif [[ $TYPE = "7.2" ]]; then
TYPE=7.2-10.10
elif [[ $TYPE = "5.3" ]]; then
TYPE=5.3-10.10
fi
fiif [[ $TYPE = "5.6" ]]; then
echo "PHP 5.6 is not available for OS X < 10.8"
exit 1
elif [[ $TYPE = "7.2" ]]; then
echo "PHP 7.2 is not available for OS X < 10.10"
exit 1
elif [[ $TYPE = "7.1" ]]; then
echo "PHP 7.1 is not available for OS X < 10.10"
exit 1
elif [[ $TYPE = "7.0" ]]; then
echo "PHP 7.0 is not available for OS X < 10.10"
exit 1
fiecho "Get packager.tgz";
curl -s -o /tmp/packager.tgz https://s3-eu-west-1.amazonaws.com/php-osx.liip.ch/packager/packager.tgzecho "Unpack packager.tgz";
echo "Please type in your password, as we want to install this into /usr/local"
if [ ! -d /usr/local ] ; then sudo mkdir /usr/local; fi
sudo tar -C /usr/local -xzf /tmp/packager.tgzif [[ -f /usr/bin/python2.7 ]]; then
PYTHONPATH=/usr/bin/python2.7
elif [[ -f /usr/bin/python2.6 ]]; then
PYTHONPATH=/usr/bin/python2.6
elif [[ -f /usr/bin/python ]]; then
PYTHONPATH=/usr/bin/python
else
PYTHONPATH=$(which python)
fiecho "Start packager (may take some time) using $PYTHONPATH";sudo $PYTHONPATH /usr/local/packager/packager.py install $TYPE-frontenddev
cd $ORIPWD
echo "Finished."

  

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295