中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

lnmp 源碼部署------2

發布時間:2020-08-06 14:34:34 來源:網絡 閱讀:480 作者:andy1灬 欄目:web開發

安裝php擴展軟件


#哈稀函數庫

[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


#處理中文各種編碼之間的轉換

[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


#對庫文件做鏈接

[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

# 對相應內容進行修改

[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


啟動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選項

}

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參數文件

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;


測試


[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]#



測試數據庫鏈接


<?php

$links=mysql_connect("localhost","root","");

if($links){

echo "link db ok!!!";

}

else{

echo "link db no!!!";

}

?>

[root@localhost html]#


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

县级市| 日照市| 焦作市| 资讯| 三台县| 鹤壁市| 太和县| 喀喇沁旗| 盐津县| 临武县| 顺平县| 田阳县| 灵武市| 沂南县| 大英县| 汉阴县| 牙克石市| 阳山县| 班玛县| 永宁县| 邢台市| 绥化市| 大丰市| 武宁县| 卫辉市| 西丰县| 徐水县| 乐东| 沙洋县| 长垣县| 陵川县| 七台河市| 东乌| 株洲市| 神池县| 吉隆县| 峨眉山市| 休宁县| 高台县| 章丘市| 伊吾县|