php-fpm可執行檔出現亂碼的解決方案_Linux

來源:互聯網
上載者:User

配置php-fpm

預設php安裝目錄:/usr/local/php
先拷貝設定檔,在進行編輯

複製代碼 代碼如下:

cp/usr/local/php/etc/php-fpm.conf.default->/usr/local/php/etc/php-fpm.conf
vi/usr/local/php/etc/php-fpm.conf

製作fpm啟動服務

複製下面的代碼,vi/etc/init.d/php-fpm,儲存

複製代碼 代碼如下:

#!/bin/bash
#php-fpmStartupscriptforphp-fpm,aFastCGIimplementation
#thisscriptwascreatedbytonyat2010.07.21,basedonjackbillow'snginxscript.
#itisv.0.0.1version.
#ifyoufindanyerrorsonthisscripts,pleasecontacttony.
#bysendingmailtotonytzhouatgmaildotcom.
#
#chkconfig:-8515
#description:php-fpmisanalternativeFastCGIimplementation,withsomeadditionalfeaturesusefulforsitesofanysize,especiallybusiersites.
#
#processname:phpfpm
#pidfile:/usr/local/php/var/run/phpfpm.pid
#config:/usr/local/php/etc/phpfpm.conf

phpfpm=/usr/local/php/sbin/php-fpm
config=/usr/local/php/lib/php.ini
pid=/usr/local/php/var/run/php-fpm.pid

RETVAL=0
prog="phpfpm"

#Sourcefunctionlibrary.
./etc/rc.d/init.d/functions

#Sourcenetworkingconfiguration.
./etc/sysconfig/network

#Checkthatnetworkingisup.
[${NETWORKING}="no"]&&exit0

[-x$phpfpm]||exit0

#Startphpfpmdaemonsfunctions.
start(){

if[-e$pid];then
echo"phpfpmisalreadyrunning...."
exit1
fi

echo-n$"Starting$prog:"
daemon$phpfpm-c${config}
RETVAL=$?
echo
[$RETVAL=0]&&touch/var/lock/subsys/phpfpm
return$RETVAL

}

#Stopphpfpmdaemonsfunctions.
stop(){
echo-n$"Stopping$prog:"
killproc$phpfpm
RETVAL=$?
echo
[$RETVAL=0]&&rm-f/var/lock/subsys/phpfpm/var/run/phpfpm.pid
}

#reloadphpfpmservicefunctions.
reload(){

echo-n$"Reloading$prog:"
#kill-HUP`cat${pid}`
killproc$phpfpm-HUP
RETVAL=$?
echo

}

#Seehowwewerecalled.
case"$1"in
start)
start
;;

stop)
stop
;;

reload)
reload
;;

restart)
stop
start
;;

status)
status$prog
RETVAL=$?

*)
echo$"Usage:$prog{start|stop|restart|reload|status|help}"
exit1
esac

exit$RETVAL

chmod+x/etc/rc.d/init.d/php-fpm#添加執行許可權
chkconfigphp-fpmon#設定開機啟動

啟動/etc/init.d/php-fpmstart
停止/etc/init.d/php-fpmstop
重啟/etc/init.d/php-fpmrestart

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.