php-fpm可執(zhí)行文件出現(xiàn)亂碼的解決方法
配置php-fpm
默認(rèn)php安裝目錄:/usr/local/php
先拷貝配置文件,在進(jìn)行編輯
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啟動服務(wù)
復(fù)制下面的代碼,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#添加執(zhí)行權(quán)限
chkconfigphp-fpmon#設(shè)置開機(jī)啟動
啟動/etc/init.d/php-fpmstart
停止/etc/init.d/php-fpmstop
重啟/etc/init.d/php-fpmrestart
相關(guān)文章
Linux中切換用戶出現(xiàn)bash-4.2$問題解決
這篇文章主要給大家介紹了關(guān)于Linux中切換用戶出現(xiàn)bash-4.2$問題解決的相關(guān)資料,我們需要進(jìn)行一個復(fù)盤,只有發(fā)生問題,才能嘗試著去解決問題,文中通過圖文介紹的非常詳細(xì),需要的朋友可以參考下2023-11-11PHP程序員玩轉(zhuǎn)Linux系列 Nginx中的HTTPS詳解
這篇文章主要為大家詳細(xì)介紹了PHP程序員玩轉(zhuǎn)Linux系列文章,MySQL備份還原教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04在麒麟V10服務(wù)器上編譯安裝Storm的詳細(xì)過程
這篇文章主要介紹了在麒麟V10服務(wù)器上編譯安裝Storm的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-01-01Linux下實(shí)現(xiàn)免密碼登錄(超詳細(xì))
這篇文章主要介紹了Linux下實(shí)現(xiàn)免密碼登錄的相關(guān)資料,非常不錯,具有參考借鑒價值,感興趣的朋友一起看看吧2016-10-10詳解linux系統(tǒng)輸入輸出管理和vim的常用功能
這篇文章主要介紹了linux系統(tǒng)輸入輸出管理和vim的常用功能,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下2019-04-04