详解Nginx1.19 php8.0 源码编译安装

发布时间:2022-05-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了详解Nginx1.19 php8.0 源码编译安装脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

推荐学习:《PHP8教程》

准备好centos7及以上的版本

第一步

下载nginx包放置在指定目录下一般放置mnt目录:

下载地址 : nginx.org/en/download.htML

详解Nginx1.19 php8.0 源码编译安装

解压nginx压缩包

tar zxvf nginx-1.19.7.tar.gz

准备依赖包:

yum -y install zlib-devel pcre-devel oPEnssl-devel

准备nginx用户:

useradd -M -s /sbin/noLOGin nginx

码编译与安装:

./configure --PRefix=/usr/local/nginx --wITh-http_stub_status_module --with-http_ssl_module --with-http_random_index_module --with-http_sub_module

make
make install

设置配置文件:

user  nginx;

服务管理:
1.检测配置语法

/usr/local/nginx/sbin/nginx -t

2.启动服务

/usr/local/nginx/sbin/nginx

3.重载服务

/usr/local/nginx/sbin/nginx -s reload
pkill -HUP nginx

4.关闭服务

/usr/local/nginx/sbin/nginx -s stop
pkill nginx

5.开机启动

vi /etc/rc.local/usr/local/nginx/sbin/nginx

进程管理:

pstree |grep nginx
ps -ef |grep nginx
ps aux |grep nginx

端口管理:

netstat -tunpl |grep nginx

客户端测试:(输入你的公网IP)

http://192.168.2.1

nginx 重载

[root@wml sbin]# pkill -HUP nginx

php8.0 源码编译安装

一 安装php8的依赖

yum -y install autoconf freetype gd libpng libpng-devel libjpeg libXMl2 libxml2-devel zlib curl curl-devel net-snmp-devel libjpeg-devel php-ldap openldap-devel openldap-clients freetype-devel gmp-devel libzip libzip-devel SQLite-devel

二 安装php8的依赖包

1.解压

tar -zxvf oniguruma-6.9.4.tar.gz

2.切换目录

cd oniguruma-6.9.4/

3生成configure

./autogen.sh

4.生成编译配置文件

./configure --prefix=/usr

5.编译并安装

make && make install

2.编译PHP8主包
1.解压

tar xzf php-8.0.0.tar.gz

2.切换目录

cd php-8.0.0/

3.生成编译配置文件

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-FPM --with-fpm-user=nginx --with-fpm-group=nginx --enable-MySQLnd --with-mysqli --with-pdo-mysql --enable-Opcache --with-pcre-JIT --enable-gd --with-jpeg --with-freetype --with-gettext --with-curl --with-openssl --enable-sockets --enable-mbstring --enable-xml --with-zip --with-zlib --with-snmp --with-mhash --enable-ftp --enable-bcmath --enable-SOAp --enable-shmop --enable-SysvSEM --enable-pcntl --with-gmp

4.编译并安装

make && make install

error 编译安装遇到的错误

详解Nginx1.19 php8.0 源码编译安装

解决办法 yum install automake

详解Nginx1.19 php8.0 源码编译安装

解决办法 执行 yum install liBTool

详解Nginx1.19 php8.0 源码编译安装

解决办法 参考 下图

详解Nginx1.19 php8.0 源码编译安装

以上就是详解Nginx1.19 php8.0 源码编译安装的详细内容,更多请关注脚本宝典其它相关文章

脚本宝典总结

以上是脚本宝典为你收集整理的详解Nginx1.19 php8.0 源码编译安装全部内容,希望文章能够帮你解决详解Nginx1.19 php8.0 源码编译安装所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: