Browse Source

Add php7 memcache extension

lj2007331 9 years ago
parent
commit
197176e0da

+ 8 - 8
apps.conf

@@ -1,10 +1,10 @@
 # newest software version
 # Web
-nginx_version=1.9.7
+nginx_version=1.9.9
 tengine_version=2.1.1
 
 tomcat_7_version=7.0.65
-tomcat_8_version=8.0.28
+tomcat_8_version=8.0.30
 
 apache_2_version=2.2.31
 apache_4_version=2.4.17
@@ -13,13 +13,13 @@ apr_version=1.5.2
 apr_util_version=1.5.4
 
 # DB
-mysql_5_7_version=5.7.9
+mysql_5_7_version=5.7.10
 mysql_5_6_version=5.6.28
-mysql_5_5_version=5.5.46
+mysql_5_5_version=5.5.47
 
 mariadb_10_1_version=10.1.9
 mariadb_10_0_version=10.0.22
-mariadb_5_5_version=5.5.46
+mariadb_5_5_version=5.5.47
 
 percona_5_6_version=5.6.27-76.0
 percona_5_5_version=5.5.46-37.6
@@ -38,10 +38,10 @@ php_7_version=7.0.0
 
 zendopcache_version=7.0.5
 xcache_version=3.2.0
-apcu_version=4.0.7
+apcu_version=4.0.10
 ImageMagick_version=6.8.8-10
-imagick_version=3.1.2
-GraphicsMagick_version=1.3.20
+imagick_version=3.3.0
+GraphicsMagick_version=1.3.23
 gmagick_version=1.1.7RC3
 libiconv_version=1.14
 libmcrypt_version=2.5.8

+ 1 - 1
include/check_os.sh

@@ -8,7 +8,7 @@
 #       http://oneinstack.com
 #       https://github.com/lj2007331/oneinstack
 
-if [ -f /etc/redhat-release -o -n "`grep 'Aliyun Linux release' /etc/issue`" ];then
+if [ -n "`grep 'Aliyun Linux release' /etc/issue`" -o -e /etc/redhat-release ];then
     OS=CentOS
     [ -n "`grep ' 7\.' /etc/redhat-release`" ] && CentOS_RHEL_version=7
     [ -n "`grep ' 6\.' /etc/redhat-release`" -o -n "`grep 'Aliyun Linux release6 15' /etc/issue`" ] && CentOS_RHEL_version=6

+ 0 - 3
include/init_CentOS.sh

@@ -89,9 +89,6 @@ ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
 #nameserver 8.8.8.8 
 #EOF
 
-# Wrong password five times locked 180s
-[ -z "`cat /etc/pam.d/system-auth | grep 'pam_tally2.so'`" ] && sed -i '4a auth        required      pam_tally2.so deny=5 unlock_time=180' /etc/pam.d/system-auth
-
 # alias vi
 [ -z "`cat ~/.bashrc | grep 'alias vi='`" ] && sed -i "s@alias mv=\(.*\)@alias mv=\1\nalias vi=vim@" ~/.bashrc && echo 'syntax on' >> /etc/vimrc
 

+ 9 - 4
include/memcached.sh

@@ -46,11 +46,16 @@ cd ..
 
 Install_php-memcache() {
 cd $oneinstack_dir/src
-if [ -e "$php_install_dir/bin/phpize" ] && [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '5' ];then
-    src_url=http://pecl.php.net/get/memcache-$memcache_pecl_version.tgz && Download_src
+if [ -e "$php_install_dir/bin/phpize" ];then
     # php memcache extension
-    tar xzf memcache-$memcache_pecl_version.tgz 
-    cd memcache-$memcache_pecl_version 
+    if [ "`$php_install_dir/bin/php -r 'echo PHP_VERSION;' | awk -F. '{print $1}'`" == '7' ];then
+        git clone https://github.com/websupport-sk/pecl-memcache.git
+        cd pecl-memcache
+    else
+        src_url=http://pecl.php.net/get/memcache-$memcache_pecl_version.tgz && Download_src
+        tar xzf memcache-$memcache_pecl_version.tgz 
+        cd memcache-$memcache_pecl_version 
+    fi
     make clean
     $php_install_dir/bin/phpize
     ./configure --with-php-config=$php_install_dir/bin/php-config

+ 4 - 4
include/percona-5.5.sh

@@ -70,14 +70,14 @@ port = 3306
 socket = /tmp/mysql.sock
 default-character-set = utf8mb4
 
-[mysqld]
-port = 3306
-socket = /tmp/mysql.sock
-
 [mysql]
 prompt="Percona [\\d]> "
 no-auto-rehash
 
+[mysqld]
+port = 3306
+socket = /tmp/mysql.sock
+
 basedir = $percona_install_dir
 datadir = $percona_data_dir
 pid-file = $percona_data_dir/mysql.pid

+ 2 - 0
include/php-5.3.sh

@@ -129,6 +129,8 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
+[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session
+[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [[ ! $Apache_version =~ ^[1-2]$ ]];then
     # php-fpm Init Script

+ 2 - 0
include/php-5.4.sh

@@ -128,6 +128,8 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
+[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session
+[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [[ ! $Apache_version =~ ^[1-2]$ ]];then
     # php-fpm Init Script

+ 2 - 0
include/php-5.5.sh

@@ -127,6 +127,8 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
+[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session
+[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [ "$PHP_cache" == '1' ];then
     sed -i 's@^\[opcache\]@[opcache]\nzend_extension=opcache.so@' $php_install_dir/etc/php.ini

+ 2 - 0
include/php-5.6.sh

@@ -128,6 +128,8 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
+[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session
+[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [ "$PHP_cache" == '1' ];then
     sed -i 's@^\[opcache\]@[opcache]\nzend_extension=opcache.so@' $php_install_dir/etc/php.ini

+ 4 - 2
include/php-7.sh

@@ -74,7 +74,7 @@ make clean
 if [[ $Apache_version =~ ^[1-2]$ ]];then
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
 --with-apxs2=$apache_install_dir/bin/apxs $PHP_cache_tmp --disable-fileinfo \
---with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
+--enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
 --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
 --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-inline-optimization \
@@ -84,7 +84,7 @@ if [[ $Apache_version =~ ^[1-2]$ ]];then
 else
     ./configure --prefix=$php_install_dir --with-config-file-path=$php_install_dir/etc \
 --with-fpm-user=$run_user --with-fpm-group=$run_user --enable-fpm $PHP_cache_tmp --disable-fileinfo \
---with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
+--enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
 --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \
 --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-exif \
 --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-inline-optimization \
@@ -128,6 +128,8 @@ sed -i 's@^disable_functions.*@disable_functions = passthru,exec,system,chroot,c
 sed -i 's@^session.cookie_httponly.*@session.cookie_httponly = 1@' $php_install_dir/etc/php.ini
 sed -i 's@^mysqlnd.collect_memory_statistics.*@mysqlnd.collect_memory_statistics = On@' $php_install_dir/etc/php.ini
 [ -e /usr/sbin/sendmail ] && sed -i 's@^;sendmail_path.*@sendmail_path = /usr/sbin/sendmail -t -i@' $php_install_dir/etc/php.ini
+[ ! -d '/tmp/session' ] && { mkdir /tmp/session; chown -R ${run_user}.${run_user} /tmp/session
+[ -z "`grep ^session.save_path $php_install_dir/etc/php.ini`" ] && sed -i "s@^;session.save_path.*@&\nsession.save_path = \"/tmp/session\"@" $php_install_dir/etc/php.ini 
 
 if [ "$PHP_cache" == '1' ];then
     sed -i 's@^\[opcache\]@[opcache]\nzend_extension=opcache.so@' $php_install_dir/etc/php.ini

+ 1 - 0
install.sh

@@ -682,6 +682,7 @@ if [ "$HHVM_yn" == 'y' ];then
 fi
 
 # Starting DB 
+[ -d "/etc/mysql" ] && /bin/mv /etc/mysql{,_bk}
 [ -d "$db_install_dir/support-files" -a -z "`ps -ef | grep -v grep | grep mysql`" ] && /etc/init.d/mysqld start
 
 echo "####################Congratulations########################"