• linux一键安装php脚本


    #!/bin/sh
    echo "----------------------------------start install php -----------------------------"
    yum -y install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel libaio
    yum -y install libmcrypt-devel  
    yum -y install libmcrypt-devel  
    yum  -y groupinstall  "Development Tools"    
    if [ 'grep "php-fpm" /etc/passwd | wc -l' ]; then
    echo "adding user php-fpm"
    groupadd php-fpm
    useradd -s /sbin/nologin -M -g php-fpm php-fpm
    else
    echo "user php-fpm exsits"
    fi
    
    echo "-----------------------------------downloading php-------------------------------"
    wget http://cn2.php.net/distributions/php-5.6.2.tar.gz
    tar -xvf php-5.6.2.tar.gz
    cd php-5.6.2
    
    echo "------------------------------------configuring php,plz wait----------------------"
    ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql=mysqlnd --with-mysql-sock=/tmp/mysql.sock
    
    if [ $? -ne 0 ];then
    echo "configure failed ,please check it out!"
    else
    echo "make php, please wait for 20 minutes"
    make
    fi
    
    if [ $? -ne 0 ];then
    echo "make failed ,please check it out!"
    else
    echo "install php, please wait for 20 minutes"
    make install
    fi
    
    chown -R php.php /usr/local/php
    cp php.ini-production /usr/local/php/etc/php.ini
    cp /usr/local/php/etc/php-fpm.conf.default  /usr/local/php/etc/php-fpm.conf
    cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
    chmod 755 /etc/init.d/php-fpm
    service php-fpm start
    chkconfig php-fpm on
  • 相关阅读:
    for循环
    条件语句练习
    语句
    语言基础
    python -- 异步IO 协程
    转--python -- 收发邮件
    hive vs hbase
    postgresql 常用速查
    转--利用hexo搭建个人静态博客
    转- --python 3 编码
  • 原文地址:https://www.cnblogs.com/wuxie1989/p/5761802.html
Copyright © 2020-2023  润新知