安裝php
烏爾禾網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)公司,烏爾禾網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為烏爾禾上1000+提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的烏爾禾做網(wǎng)站的公司定做!安裝依賴包
yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel –y
安裝epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
yum -y install libmcrypt-devel mcytpt mhash libxslt-devel
安裝libiconv
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure –prefix=/usr/lcoal/libiconv
Make && make install
解壓安裝包
tar -zxvf php-5.6.20.tar.gz
配置編譯安裝
cd php-5.6.20
./configure \
–prefix=/usr/local/php-5.6.20 \
–with-config-file-path=/usr/local/php-5.6.20/etc \
–with-fpm-user=nginx \
–with-fpm-group=nginx \
–with-bz2 \
–with-curl \
–with-gd \
–with-mcrypt \
–with-openssl \
–with-mhash \
–with-jpeg-dir \
–with-png-dir \
–with-freetype-dir \
–with-iconv-dir=/usr/local/libiconv \
–with-gettext \
–with-libxml-dir=/usr/local \
–with-zlib \
–with-xsl \
–with-pdo-mysql=mysqlnd \
–with-mysql=mysqlnd \
–with-mysqli=mysqlnd \
–with-libdir=lib64 \
–enable-dom \
–enable-xml \
–enable-fpm \
–enable-bcmath \
–enable-ftp \
–enable-sockets \
–disable-ipv6 \
–enable-mbregex \
–enable-mbstring \
–enable-calendar \
–enable-gd-native-ttf \
–enable-static \
make
make install
cp php.ini-production /usr/local/php/lib/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cd /usr/local/php/
mkdir log
編輯配置文件
pid = /var/log/php-fpm.pid
error_log = log/php-fpm.log
log_level = error
rlimit_files = 32768
events.mechanism = epoll
[www]
user = nginx
group = nginx
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 1024
pm.start_servers = 16
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.process_idle_timeout = 15s;
pm.max_requests = 2048
slowlog = log/$pool.log.slow
request_slowlog_timeout = 10
創(chuàng)建啟動(dòng)停止腳本:
vim /etc/init.d/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=${prefix}
php_fpm_BIN=${exec_prefix}/sbin/php-fpm
php_fpm_CONF=${prefix}/etc/php-fpm.conf
php_fpm_PID=${prefix}/var/run/php-fpm.pid
php_opts=”–fpm-config $php_fpm_CONF –pid $php_fpm_PID”
wait_for_pid () {
try=0
while test $try -lt 35 ; do
case “$1” in
‘created’)
if [ -f “$2” ] ; then
try=”
break
fi
;;
‘removed’)
if [ ! -f “$2” ] ; then
try=”
break
fi
;;
esac
echo -n .
try=`expr $try + 1`
sleep 1
done
}
case “$1” in
start)
echo -n “Starting php-fpm “
$php_fpm_BIN –daemonize $php_opts
if [ “$?” != 0 ] ; then
echo ” failed”
exit 1
fi
wait_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
fi
kill -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
fi
PID=`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
fi
kill -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
fi
kill -USR2 `cat $php_fpm_PID`
echo ” done”
;;
configtest)
$php_fpm_BIN -t
;;
*)
echo “Usage: $0 {start|stop|force-quit|restart|reload|status|configtest}”
exit 1
;;
esac
賦予權(quán)限
chmod +x /etc/init.d/php-fpm
啟動(dòng)
[root@zabbix-server php-5.6.20]# service php-fpm start
Starting php-fpm done
[root@zabbix-server php-5.6.20]# netstat -anpt |grep php-fpm
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 16070/php-fpm
配置nginx 支持php
打開配置文件在server區(qū)塊加入下面內(nèi)容(這里是虛擬主機(jī),網(wǎng)站根目錄也在cj下面)
server {
listen 80;
server_name www.cj.com cj.com;
charset utf-8;
#access_log logs/access_cj.log main;
access_log logs/access_cj.log;
location / {
root html/cj;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/cj$fastcgi_script_name;
include fastcgi_params;
}
}
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
本文名稱:centos6.5安裝php5.6-創(chuàng)新互聯(lián)
網(wǎng)站地址:http://www.rwnh.cn/article10/dscgdo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、域名注冊(cè)、面包屑導(dǎo)航、微信小程序、關(guān)鍵詞優(yōu)化、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容
移動(dòng)網(wǎng)站建設(shè)知識(shí)