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
创新互联-专业网站定制、快速模板网站建设、高性价比青川网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式青川网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖青川地区。费用合理售后完善,10余年实体公司更值得信赖。
/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
//输入:
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
Success!!";
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/