Linux php5.4 startup script, linuxphp5.4 script _php Tutorial

Source: Internet
Author: User

Linux under php5.4 startup script, linuxphp5.4 script


Nonsense not much to say directly on the steps
1. Modify the php-fpm.conf configuration file
Modify/usr/local/php/etc/php-fpm.conf (Of course, this is related to your configured PHP path) configuration file

Start Pid=run/php-fpm.pid

; Pid file; note:the default prefix Is/usr/local/php/var; Default value:nonepid = Run/php-fpm.pid

Start Error_log=log/php-fpm.log

; Error log file; If It's set to "Syslog", log was sent to Syslogd instead of being written; In a local file.; note:the default prefix Is/usr/local/php/var; Default Value:log/php-fpm.logerror_log = Log/php-fpm.log

2. Create a/etc/init.d/php file

root@aliyun:~# cat/etc/init.d/php#!/bin/bash#author:iranw#e-mail:wang_wenguan#yeah.net#website:http:// www.phpno.com # pid Filepid= "/usr/local/php/var/run/php-fpm.pid" # php-fpm path&filephpfpm= "/usr/local/php/sbin/ PHP-FPM "param=$1 phpnum= ' Ps-ef | grep php-fpm | Wc-l ' If ["$param" = "Stop"]; Then if ["$phpnum" = "1"];        Then echo, "Php process does not exist." Exit 1 fi kill ' cat $pid ' echo ' Close PHP processes. Ok "Exit 1fi if [" $param "=" Start "]; Then if ["$phpnum"! = "1"];        Then echo "PHP process exist." Exit 1 fi $phpfpm echo "Open PHP processes. Ok "Exit 1fi if [" $param "=" restart "]; Then if ["$phpnum" = "1"]; Then echo ' PHP process does not exist.    Stop Failed. " Else kill ' cat $pid ' for i in ' ps-ef | grep php-fpm | Grep-v grep |        awk {' Print $ '} ' do kill-9 $i echo "Kill $i successed." Done echo "Close PHP processes. Ok "fi $phpfpm    If ["$phpnum"! = "1"]; Then echo "Open PHP processes. OK "Else echo" Open PHP processes.    Failed. " Fi exit 1fi

3. Modify Permissions

#chmod +x/etc/init.d/php

4. Implementation results


Linux Startup scripts

Suppose you save the file name as: smple.sh

Then it is:
chmod 755 smple.sh This is to give him permission to run
Then you can run it directly.
SH smple.sh
Or
./smple.sh
Or
SOURCE smple.sh

Linux system service startup script in which directory

Depending on which Linux distribution you are using, usually in directories such as/ETC/RC.D/ETC/INIT.D

http://www.bkjia.com/PHPjc/856992.html www.bkjia.com true http://www.bkjia.com/PHPjc/856992.html techarticle Linux under php5.4 startup script, linuxphp5.4 script nonsense not much to say, directly on Step 1, modify php-fpm.conf configuration file Modification/usr/local/php/etc/php-fpm.conf (of course this with you configured ...

  • 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.