博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
yaf自动安装
阅读量:2238 次
发布时间:2019-05-09

本文共 4415 字,大约阅读时间需要 14 分钟。

#!/bin/bashPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATH# Check if user is rootif [ $(id -u) != "0" ]; then    echo "Error: You must be root to run this script, please use root to install lnmp"    exit 1ficlearecho "======================================================================="echo "Install Yaf for LNMP ,  Written by Licess "echo "======================================================================="echo "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux "echo "This script is a tool to install Yaf for lnmp "echo ""echo "more information please visit http://www.lnmp.org "echo "======================================================================="cur_dir=$(pwd)        	ver="new"	echo "Which version do you want to install:"	echo "Install Yaf 2.2.9 stable please type: s"	echo "Install Yaf 2.3.2 beta please type: b"	read -p "Type old or new (Default install Yaf 2.2.9 stable):" ver	if [ "$ver" = "" ]; then		ver="s"	fi	if [ "$ver" = "s" ]; then		echo "You will install Yaf 2.2.9 stable"	elif [ "$ver" = "b" ]; then 		echo "You will install Yaf 2.3.2 beta"	else		echo "Input error,please input s or b !"		echo "Please Rerun $0"		exit 1	fi	get_char()	{	SAVEDSTTY=`stty -g`	stty -echo	stty cbreak	dd if=/dev/tty bs=1 count=1 2> /dev/null	stty -raw	stty echo	stty $SAVEDSTTY	}	echo ""	echo "Press any key to start...or Press Ctrl+c to cancel"	char=`get_char`echo "=========================== Install Yaf ======================"if [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/yaf.so ]; then	rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/yaf.soelif [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/yaf.so ]; then	rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/yaf.soelif [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/yaf.so ]; then	rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/yaf.soelif [ -s /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/yaf.so ]; then	rm -f /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/yaf.soficur_php_version=`/usr/local/php/bin/php -v`if [[ "$cur_php_version" =~ "PHP 5.2." ]]; then   zend_ext="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/yaf.so"elif [[ "$cur_php_version" =~ "PHP 5.3." ]]; then   zend_ext="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/yaf.so"elif [[ "$cur_php_version" =~ "PHP 5.4." ]]; then   zend_ext="/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/yaf.so"elif [[ "$cur_php_version" =~ "PHP 5.5." ]]; then   zend_ext="/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/yaf.so"else	echo "Error: can't get php version!"	echo "Maybe your php was didn't install or php configuration file has errors.Please check."	sleep 3	exit 1fifunction install_s_yaf{if [ -s yaf-2.2.9 ]; then	rm -rf yaf-2.2.9/fised -i '/yaf.so/d' /usr/local/php/etc/php.iniwget -c http://pecl.php.net/get/yaf-2.2.9.tgztar zxf yaf-2.2.9.tgzcd yaf-2.2.9//usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make installcd ../sed -i '/the dl()/i\	extension = "yaf.so"' /usr/local/php/etc/php.ini}function install_b_yaf{if [ -s yaf-2.3.2 ]; then	rm -rf yaf-2.3.2/fised -i '/yaf.so/d' /usr/local/php/etc/php.iniwget -c http://pecl.php.net/get/yaf-2.3.2.tgztar zxf yaf-2.3.2.tgzcd yaf-2.3.2//usr/local/php/bin/phpize./configure --with-php-config=/usr/local/php/bin/php-configmake && make installcd ../sed -i '/the dl()/i\	extension = "yaf.so"' /usr/local/php/etc/php.ini}if [ "$ver" = "s" ]; then	install_s_yafelse	install_b_yaffiif [ -s /etc/init.d/httpd ] && [ -s /usr/local/apache ]; thenecho "Restarting Apache......"/etc/init.d/httpd -k restartelseecho "Restarting php-fpm......"/etc/init.d/php-fpm restartfiecho "===================== install yaf completed    ========================"echo "Install yaf completed,enjoy it!"echo "======================================================================="echo "Install yaf for LNMP  ,  Written by Wangys "echo "======================================================================="echo "LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux "echo "This script is a tool to install wangys for lnmp "echo ""echo "For more information please visit http://www.lnmp.org "echo "======================================================================="

转载地址:http://ipabb.baihongyu.com/

你可能感兴趣的文章
什么是N+1查询?
查看>>
Spring 接管 Hibernate 配置 延迟加载
查看>>
找出不在预定数组中的自然数
查看>>
String常见面试题
查看>>
直插,快排,堆排,归并排序的分析
查看>>
二叉树的各种操作(面试必备)
查看>>
oracle
查看>>
泛型与通配符详解
查看>>
BaseServiceImpl中的实现关键点
查看>>
Struts2中的session、request、respsonse获取方法
查看>>
如何理解MVC模型
查看>>
SpringMVC中乱码解决方案
查看>>
SpringMVC中时间格式转换的解决方案
查看>>
post和get请求相关知识点
查看>>
关于try finally 中的return语句的问题
查看>>
RequestBody/ResponseBody处理Json数据
查看>>
springmvc请求参数获取的几种方法
查看>>
在eclipse中创建和myeclipse一样的包结构
查看>>
Java中的IO流
查看>>
java中的关键字
查看>>