Compile and install php-fpm restart script

Source: Internet
Author: User

Tag: phpfpm restart PHP script

#!/bin/bashpid= "/opt/php7/var/run/php-fpm.pid" ini= "/opt/php7/etc/php.ini" conf= "/opt/php7/etc/php-fpm.conf" if  [ -f /opt/php7/var/run/php-fpm.pid ];thenecho  "Pid exists" fiif [ -f  /opt/php7/etc/php.ini ];thenecho  "Ini file exists" FIIF [ -F /OPT/PHP7 /etc/php-fpm.conf ];thenecho  "Php-fpm configure file exists" fiecho $1case $ 1 instart)   if [ -f  $pid  ];then    echo  "Process  already exists. "   else    /opt/php7/sbin/php-fpm -c  $ini  -y  $conf       if  (( $?==0 ));then      echo  "Start  php-fpm success "    else      echo " Start  faild ... "    fi  fi  ;; Stop)   if [ -f&nbsp, $pid  ];then    echo  "Stop php-fpm process"      kill $ (cat  $pid)     if  (( $?==0 ));then       echo  "Stop php-fpm over."     else      echo  "Stop php-fpm faild ..."     fi  else    echo  "Check process exists?"   fi;; Restart)   if [ -f  $pid  ];then    kill $ (cat  $pid)     if  (( $?==0 ));then      echo  "Stop  php-fpm over "      /opt/php7/sbin/php-fpm -c  $ini  -y   $conf       if  (( $?==0 ));then         echo  "Start php-fpm over" &Nbsp;     else        echo  "Start  Faild "      fi    else       echo  "Stop faild"     fi  else    /opt/php7/sbin/ php-fpm -c  $ini  -y  $conf     if  (( $?==0 ));then       echo  "Start php-fpm over"     else       echo  "Star faild"     fi  fi;; *)   echo  "usage: php.sh  (start|stop|restart)" Esac



Readme:

Save As Shell script file, run directly, will prompt the use of methods, according to the installation environment, modify the PID INI conf and other file paths.




This article is from the "Thousand Face" blog, please make sure to keep this source http://oslibo.blog.51cto.com/10854638/1913101

Compile and install php-fpm restart script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.