yum -y install \
libjpeg \
libjpeg-devel \
libpng libpng-devel \
libxml2 \
libxml2-devel \
freetype freetype-devel \
zlib zlib-devel \
curl curl-devel \
openssl openssl-devel
----------------------------------------------
//参数解释
libjpeg libjpeg-devel //识别jpg图片
libpng lbpng-devel //识别png图片
freetype freetype-devel //字体识别
libxml2 libxml2-devel //用于xml文件的识别
zlib zlib-devel //压缩功能
curl curl-devel //curl支持网页上传、下载
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
/usr/local/php/bin/php -m
#配置及优化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
//输入:
<?php
phpinfo();
?>
systemctl restart nginx
//测试网页
http://192.168.111.141/index.php
mysql -u -root -p //输入密码 “abc123”登录
/创建一个数据库//
CREATE DATABASE bbs;
GRANT all ON bbs.* TO 'bbsuser'@'%' IDENTIFIED BY 'admin123';
GRANT all ON bbs.* TO 'bbsuser'@'localhost' IDENTIFIED BY 'admin123';
//刷新数据库//
mysql>flush privileges;
//原来的测试页内容更改:
vim /usr/local/nginx/html/index.php
<?php
$link=mysqli_connect('192.168.111.141','bbsuser','admin123');
if($link) echo "<h2>Success!!</h2>";
else echo "Faill!!";
?>
systemctl restart nginx
在网页测试“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/
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。