安裝lnmp環境,php5.4.37版本安裝成功,新增php-fpm服務到系統啟動項時,報錯service php-fpm does not support chkconfig;php-fpm服務不支援chkconfig;
從同樣環境下同樣的php版本拷貝php-fpm啟動指令碼,重新編輯黏貼過來,儲存退出後,可以正常加入啟動項;有遇到同樣情況的朋友可以直接複製指令碼,保持與指令碼內容的路徑一樣即可。
#! /bin/sh### begin init info
# provides: php-fpm
# required-start: $remote_fs $network
# required-stop: $remote_fs $network
# default-start: 2 3 4 5
# default-stop: 0 1 6
# short-description: starts php-fpm
# description: starts the php fastcgi process manager daemon
### end init info
prefix=/usr/local/php
exec_prefix=$
php_fpm_bin=$/sbin/php-fpm
php_fpm_conf=$/etc/php-fpm.conf
php_fpm_pid=$/var/run/php-fpm.pid
php_opts="--fpm-config $php_fpm_conf --pid $php_fpm_pid"
wait_for_pid ()
case "$1" in
start)
echo -n "starting php-fpm "
$php_fpm_bin --daemonize $php_opts
if [ "$?" != 0 ] ; then
echo " failed"
exit 1
fiwait_for_pid created $php_fpm_pid
if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi;; stop)
echo -n "gracefully shutting down php-fpm "
if [ ! -r $php_fpm_pid ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fikill -quit `cat $php_fpm_pid`
wait_for_pid removed $php_fpm_pid
if [ -n "$try" ] ; then
echo " failed. use force-quit"
exit 1
else
echo " done"
fi;; status)
if [ ! -r $php_fpm_pid ] ; then
echo "php-fpm is stopped"
exit 0
fipid=`cat $php_fpm_pid`
if ps -p $pid | grep -q $pid; then
echo "php-fpm (pid $pid) is running..."
else
echo "php-fpm dead but pid file exists"
fi;; force-quit)
echo -n "terminating php-fpm "
if [ ! -r $php_fpm_pid ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fikill -term `cat $php_fpm_pid`
wait_for_pid removed $php_fpm_pid
if [ -n "$try" ] ; then
echo " failed"
exit 1
else
echo " done"
fi;; restart)
$0 stop
$0 start
;; reload)
echo -n "reload service php-fpm "
if [ ! -r $php_fpm_pid ] ; then
echo "warning, no pid file found - php-fpm is not running ?"
exit 1
fikill -usr2 `cat $php_fpm_pid`
echo " done"
;; *)
echo "usage: $0 "
exit 1
;;esac
CentOS 環境下 搭建 LNMP環境
關掉防火牆,避免實驗中出現伺服器無法訪問的情況 chkconfig iptables off安裝lnmp環境所需的開發包和庫檔案 yum y install ntp make openssl openssl devel pcre pcre devel libpng libpng devel libj...
mac下php fpm總是啟動不了
昨天一下午加今天半上午都沒有解決,同事李幫忙給配置好了。php fpm.conf 下引用的 include private etc php fpm.d php fpm.d conf php fpm.d 多了一層這個下面的.conf也很重要。global 的log 檔案報錯找不到可以新建乙個空的。er...
Lnmp環境下搭建SVN
第一步 安裝svn yum install subversion 第二步 在 usr local下建立svn資料夾並賦予777 chmod r 777 usr local svn 第三步 建立版本庫 svnadmin create usr local svn project 其中project等資料...