您好,登錄后才能下訂單哦!
準(zhǔn)備工作
1.yum安裝所需軟件包
# yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers1
2.yum源沒有l(wèi)ibmcrypt包,采用源碼安裝。
# cd /usr/local/src/# wget http://ncu.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz# ./configure prefix=/usr/local/libmcrypt# make && make install # echo$?12345
3.下載php源碼包,解壓
# wget http://am1.php.net/distributions/php-5.6.29.tar.bz2# tar jxvf php-5.6.29.tar.bz2# cd php-5.6.29123
安裝過程
1.創(chuàng)建用戶php-fpm
# useradd -s /sbin/nologin php-fpm
準(zhǔn)備工作
1.yum安裝所需軟件包
# yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers1
2.yum源沒有l(wèi)ibmcrypt包,采用源碼安裝。
# cd /usr/local/src/# wget http://ncu.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz# ./configure prefix=/usr/local/libmcrypt# make && make install # echo$?12345
3.下載php源碼包,解壓
# wget http://am1.php.net/distributions/php-5.6.29.tar.bz2# tar jxvf php-5.6.29.tar.bz2# cd php-5.6.29123
安裝過程
1.創(chuàng)建用戶php-fpm
# useradd -s /sbin/nologin php-fpm
3.編譯和安裝
# make && make install# echo $?12
4.修改配置文件
# cp php.ini-production /usr/local/php/etc/php.ini# vim /usr/local/php/etc/php-fpm.conf# /usr/local/php/sbin/php-fpm -t123
php-fpm.conf修改項(xiàng)如下: [global] pid = /usr/local/php/var/run/php-fpm.pid error_log = /usr/local/php/var/log/php-fpm.log [www] listen = /tmp/php-fcgi.sock user = php-fpm group = php-fpm pm = dynamic pm.max_children = 50 pm.start_servers = 20 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 500 rlimit_files = 1024 運(yùn)行/usr/local/php/sbin/php-fpm -t,若結(jié)果為“test is successful”,則配置正確。
5.拷貝php-fpm啟動(dòng)腳本到/etc/init.d/,更改權(quán)限
# cp /usr/local/src/php-5.6.29/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm# chmod 755 /etc/init.d/php-fpm# service php-fpm start123
若使php-fpm開機(jī)啟動(dòng),運(yùn)行chkconfig --add php-fpm;chkconfig php-fpm on。 查看服務(wù)是否啟動(dòng),運(yùn)行ps aux | grep php。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。