安裝php擴(kuò)展軟件
創(chuàng)新互聯(lián)專注于企業(yè)成都全網(wǎng)營銷推廣、網(wǎng)站重做改版、庫倫網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5場(chǎng)景定制、商城系統(tǒng)網(wǎng)站開發(fā)、集團(tuán)公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為庫倫等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。#哈稀函數(shù)庫
[root@localhost ~ ]# tar -zxvf mhash-0.9.9.9.tar.gz
[root@localhost mhash-0.9.9.9]# cd mhash-0.9.9.9
[root@localhost mhash-0.9.9.9]# ./configure
[root@localhost mhash-0.9.9.9]# make
[root@localhost mhash-0.9.9.9]# make install
#處理中文各種編碼之間的轉(zhuǎn)換
[root@localhost ~ ]# tar -zxvf libiconv-1.13.tar.gz
[root@localhost libiconv-1.13]# cd libiconv-1.13
[root@localhost libiconv-1.13]# ./configure
[root@localhost libiconv-1.13]# make
[root@localhost libiconv-1.13]# make install
[root@localhost libmcrypt-2.5.8]# tar -zxvf libmcrypt-2.5.8.tar.gz
[root@localhost libmcrypt-2.5.8]# cd libmcrypt-2.5.8
[root@localhost libmcrypt-2.5.8]# ./configure
[root@localhost libmcrypt-2.5.8]# make
[root@localhost libmcrypt-2.5.8]# make install
[root@localhost libmcrypt-2.5.8]# ldconfig -v
[root@localhost libmcrypt-2.5.8]# cd libltdl
[root@localhost libltdl ]# ./configure --with-gmetad --enable-gexec
--enable-ltdl-install
[root@localhost libltdl ]# make && make install
#對(duì)庫文件做鏈接
[root@localhost ~ ]# ln -sv /usr/local/lib/libmcrypt* /usr/lib/
[root@localhost ~ ]# ln -sv /usr/local/lib/libmhash.* /usr/lib/
#跟新鏈接庫
[root@localhost ~ ] # ldconfig -v
安裝php
14
root@localhost ~]# tar -zxvf php-5.4.9.tar.gz
[root@localhost ~]# cd php-5.4.9
[root@localhost php-5.4.9]# ./configure \
--prefix=/usr/local/php5nginx \
--with-config-file-path=/usr/local/php5nginx/etc \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-iconv-dir=/usr/local \
--with-freetype-dir --with-jpeg-dir \
--with-png-dir --with-zlib --with-libxml-dir=/usr \
--enable-xml --disable-rpath --enable-bcmath \
--enable-shmop --enable-sysvsem \
--enable-inline-optimization --with-curl --with-curlwrappers \
--enable-mbregex --enable-fpm --enable-mbstring \
--with-mcrypt --with-gd --enable-gd-native-ttf \
--with-openssl --with-mhash --enable-pcntl \
--enable-sockets --with-ldap --with-ldap-sasl \
--with-xmlrpc --enable-zip --enable-soap \
[root@localhost php-5.4.9]# make ZEND_EXTRA_LIBS='-liconv'
[root@localhost php-5.4.9]# make install
[root@localhost php-5.4.9]# cp php.ini-production \
>/usr/local/php5nginx/etc/php.ini
配置fast-cgi
[root@localhost ~]# cd /usr/local/php5nginx/etc/
[root@localhost etc]# cp php-fpm.conf.default php-fpm.conf
[root@localhost etc]# vim php-fpm.conf
# 對(duì)相應(yīng)內(nèi)容進(jìn)行修改
[global]
pid = run/php-fpm.pid
error_log = log/php-fpm.log
log_level = error
daemonize = yes
[www]
user = www
group = www
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 32
pm.start_servers = 15
pm.min_spare_servers = 5
pm.max_spare_servers = 32
啟動(dòng)php-fpm
[root@localhost ~]# cd php-5.4.9/sapi/fpm/
[root@localhost fpm]# cp init.d.php-fpm /etc/rc.d/init.d/php-fpm
[root@localhost fpm]# chmod +x /etc/rc.d/init.d/php-fpm
[root@localhost fpm]# chkconfig --add php-fpm
[root@localhost fpm]# service php-fpm start|restart|reload|restart
[root@localhost fpm]# ps aux | grep php-fpm
編輯nginx.conf文件
[root@localhost ~ ]# vim /usr/local/nginx/conf/nginx.conf
location / {
root html;
index index.php index.html index.htm; //添加index.php選項(xiàng)
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; // Fast-cgi參數(shù)文件
include fastcgi_params;
}
編輯fastcgi_params文件
[root@localhost ~ ]# vim /usr/local/nginx/conf/fastcgi_params
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
……
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
……
fastcgi_param DOCUMENT_ROOT $document_root;
測(cè)試
[root@localhost ~]# pkill -9 nginx
[root@localhost ~]# /usr/local/nginx/sbin/nginx
[root@localhost ~]# /etc/rc.d/init.d/php-fpm restart
[root@localhost html]# vim index.php
<?php
phpinfo();
?>
[root@localhost html]#
測(cè)試數(shù)據(jù)庫鏈接
<?php
$links=mysql_connect("localhost","root","");
if($links){
echo "link db ok!!!";
}
else{
echo "link db no!!!";
}
?>
[root@localhost html]#
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。
網(wǎng)頁標(biāo)題:lnmp源碼部署------2-創(chuàng)新互聯(lián)
當(dāng)前鏈接:http://jinyejixie.com/article26/ccsecg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供虛擬主機(jī)、域名注冊(cè)、全網(wǎng)營銷推廣、軟件開發(fā)、網(wǎng)站改版、微信公眾號(hào)
聲明:本網(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)容