yum -y install \
libjpeg \
libjpeg-devel \
libpng libpng-devel \
libxml2 \
libxml2-devel \
freetype freetype-devel \
zlib zlib-devel \
curl curl-devel \
openssl openssl-devel
----------------------------------------------
//參數(shù)解釋
libjpeg libjpeg-devel //識別jpg圖片
libpng lbpng-devel //識別png圖片
freetype freetype-devel //字體識別
libxml2 libxml2-devel //用于xml文件的識別
zlib zlib-devel //壓縮功能
curl curl-devel //curl支持網(wǎng)頁上傳、下載
openssl openssl-devel //身份驗證登錄
cd /abc/LNMP
tar jxvf php-7.1.10.tar.bz2 -C /opt/
cd /opt/php-7.1.10/
./configure \
--prefix=/usr/local/php \
--with-mysql-sock=/usr/local/mysql/mysql.sock \
--with-mysqli \
--with-zlib \
--with-curl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-openssl \
--enable-fpm \
--enable-mbstring \
--enable-xml \
--enable-session \
--enable-ftp \
--enable-pdo \
--enable-tokenizer \
--enable-zip
make && make install
//主配置文件
cp php.ini-development /usr/local/php/lib/php.ini
vim /usr/local/php/lib/php.ini
//輸入 /default_sock 查找
mysqli.default_socket = /usr/local/mysql/mysql.sock
// 輸入 /data.time 查找,把前面的‘ ;’注釋符去掉。
date.timezone = Asia/Shanghai
創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設、高性價比青川網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式青川網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設找我們,業(yè)務覆蓋青川地區(qū)。費用合理售后完善,10余年實體公司更值得信賴。
/usr/local/php/bin/php -m
#配置及優(yōu)化FPM模塊
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf
//把注釋符號‘;’去掉
pid = run/php-fpm.pid
同樣這個php-fpm.d也要復制一份默認模板
cd /usr/local/php/etc/php-fpm.d/
cp www.conf.default www.conf
/usr/local/php/sbin/php-fpm -c /usr/local/php/lib/php.ini
netstat -anpt | grep 9000
ln -s /usr/local/php/bin/* /usr/local/bin
ps aux | grep -c "php-fpm"
vim /usr/local/nginx/conf/nginx.conf
//輸入 location ~ \.php$ 查找
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
inclide fastcgi_params;
}
vim /usr/local/nginx/html/index.php
//輸入:
systemctl restart nginx
//測試網(wǎng)頁
http://192.168.111.141/index.php
mysql -u -root -p //輸入密碼 “abc123”登錄
/創(chuàng)建一個數(shù)據(jù)庫//
CREATE DATABASE bbs;
GRANT all ON bbs.* TO 'bbsuser'@'%' IDENTIFIED BY 'admin123';
GRANT all ON bbs.* TO 'bbsuser'@'localhost' IDENTIFIED BY 'admin123';
//刷新數(shù)據(jù)庫//
mysql>flush privileges;
//原來的測試頁內容更改:
vim /usr/local/nginx/html/index.php
Success!!";
else echo "Faill!!";
?>
systemctl restart nginx
在網(wǎng)頁測試“http://192.168.111.141/index.php”
cd /abc/LNMP
unzip Discuz_x3.4_SC_UTF8.zip -d /opt
cd /opt/dir_SC_UTF8/
cp -r upload/ /usr/local/nginx/html/bbs/
cd /usr/local/nginx/html/bbs/
chown -R root:nginx ./config/
chown -R root:nginx ./data/
chown -R root:nginx ./uc_client/
chown -R root:nginx ./uc_server/
chmod -R 777 ./config/
chmod -R 777 ./data/
chmod -R 777 ./uc_client/
chmod -R 777 ./uc_server/