nginx部署
https://www.jianshu.com/p/9c577eaf459d
mariadb安装
mariadb也有自己的用户去管理:就是mysql用户
首先我们要添加用户并安装centos扩展源
下面安装依赖包
yum -y install ncurses-devel readline-devel zlib-devel openssl-devel libxml2-devel libxml2 cracklib-devel libevent libevent-devel pam-devel opencv opencv-devel jemalloc jemalloc-devel libaio libaio-devel
初始化
启动成功
PHP安装
下载:https://www.php.net/downloads.php
安装libmcrypt:https://blog.csdn.net/nianyixiaotian/article/details/82706927
将上面三个文件解压到/opt目录下
接着
make
make install
ln -s /usr/local/lib/libmcrypt.* /usr/lib
接着
make
make install
ln -s /usr/local/lib/libmhash* /usr/lib
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
make
make install
下面安装PHP
./configure --prefix=/usr/local/php7 --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/ --enable-xml --enable-sockets --with-mcrypt --with-config-file-path=/usr/local/php7 --with-config-file-scan-dir=/usr/local/php7/php.d --with-bz2 --enable-maintainer-zts --enable-mysqlnd --with-pdo-mydql=mysqlnd --with-mysqli=mysqlnd --with-gd --with-curl --enable-fpm
再试一次
接着make时间会长一些
最后make install
然后为PHP准备配置文件
为php-fpm准备启动文件
准备配置文件
添加系统服务并开启
最后整个nginx和php
vi /etc/nginx/nginx.conf
下面编辑vi /etc/nginx/fastcgi_params
重启服务并测试
测试一下数据库连接
OK
网友评论