红帽9中nginx-源码编译php

什么是PHP-FPM? PHP-FPM(FastCGI Process Manager: FastCGI进程管理器)是一个实现了Fastcgi的程序,并且提供进程管理的功能。 进程包括master进程和worker进程。master进程只有一个,负责监听端口,接受来自web server 的请求 worker进程一般会有多个,每个进程中会嵌入一个PHP解析器,进行PHP代码的处理。

1.先源码编译nginx,root底下存在最新版模块

2.进入nginx-1.26.1的目录,执行编译安装

复制代码
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx  --with-http_ssl_module --with-http_v2_module --with-http_realip_module  --with-http_gzip_static_module  --with-http_stub_status_module  --with-pcre --with-stream  --with-stream_ssl_module

3.安装文件

4.检测参数nginx安装是否成功

5.对php源码编译,对软件包进行解压

root@nginx-node1 \~\]# tar zxf php-8.3.9.tar.gz ![](https://i-blog.csdnimg.cn/direct/18dbfd3b83ae43748342148e0c4ea49f.png) 4.利用yum解决php依赖 \[root@Nginx \~\]# yum install -y bzip2 systemd-devel libxml2-devel sqlite-devel libpng-devel libcurl-devel oniguruma-devel ![](https://i-blog.csdnimg.cn/direct/1e8d3128110c4b4395d42ceeff90ba21.png) 但是缺失软件包 ![](https://i-blog.csdnimg.cn/direct/d0ea910f09e04b10a0747c31b3e8620d.png) 寻找软件包命令 [root@nginx-node1 ~]# yum search oniguruma [root@nginx-node1 ~]# yum whatprovides */oniguruma* 如果代码搜索不到可以使用---阿里云开源软件镜像站进行搜索 ![](https://i-blog.csdnimg.cn/direct/40f46d8ce7b94ff5891320448387c07b.png) 5.进入php目录,对php进行源码安装 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-iconv --with-mhash --with-zlib --with-openssl --enable-mysqlnd --with-mysqli --with-pdo-mysql --disable-debug --enable-sockets --enable-soap --enable-xml --enable-ftp --enable-gd --enable-exif --enable-mbstring --enable-bcmath --with-fpm-systemd ![](https://i-blog.csdnimg.cn/direct/720ebd30f2284c8180bfdde20bfc11aa.png) 检测发现还缺失libsystemd包 ![](https://i-blog.csdnimg.cn/direct/747fb536ad6b499e8eb73123e0a837bd.png) 安装libcurl-devel-7.76.1-19.el9.x86_64软件包 \[root@localhost php-8.3.9\]# yum install libcurl-devel-7.76.1-19.el9.x86_64 -y 使用源码再次安装,检测发现还缺失sqlite3包 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-iconv --with-mhash --with-zlib --with-openssl --enable-mysqlnd --with-mysqli --with-pdo-mysql --disable-debug --enable-sockets --enable-soap --enable-xml --enable-ftp --enable-gd --enable-exif --enable-mbstring --enable-bcmath --with-fpm-systemd ![](https://i-blog.csdnimg.cn/direct/38425dc3237e45ffbba32d9657efeed9.png) 安装 sqlite-devel.x86_64软件包 \[root@localhost php-8.3.9\]# yum install sqlite-devel.x86_64 -y 使用源码再次安装,检测发现还缺失libpng包 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-iconv --with-mhash --with-zlib --with-openssl --enable-mysqlnd --with-mysqli --with-pdo-mysql --disable-debug --enable-sockets --enable-soap --enable-xml --enable-ftp --enable-gd --enable-exif --enable-mbstring --enable-bcmath --with-fpm-systemd ![](https://i-blog.csdnimg.cn/direct/594786f17d9b4768bd152f8529884a4d.png) 安装libpng-devel.x86_64软件包 \[root@localhost php-8.3.9\]# yum install libpng-devel.x86_64 -y 使用源码再次安装,检测发现还缺失oniguruma包 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-iconv --with-mhash --with-zlib --with-openssl --enable-mysqlnd --with-mysqli --with-pdo-mysql --disable-debug --enable-sockets --enable-soap --enable-xml --enable-ftp --enable-gd --enable-exif --enable-mbstring --enable-bcmath --with-fpm-systemd ![](https://i-blog.csdnimg.cn/direct/0007f8a12d794f54b7c2a64d7bbb311a.png) 在阿里云开源软件镜像站获取软件包的下载地址 ![](https://i-blog.csdnimg.cn/direct/e7a141ddd3d44e81a69172cd3ec3004d.png) 使用yum进行安装 \[root@localhost \~\]# yum install oniguruma-devel-6.9.6-1.el9.5.x86_64.rpm 再次使用源码进行编译 ./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-curl --with-iconv --with-mhash --with-zlib --with-openssl --enable-mysqlnd --with-mysqli --with-pdo-mysql --disable-debug --enable-sockets --enable-soap --enable-xml --enable-ftp --enable-gd --enable-exif --enable-mbstring --enable-bcmath --with-fpm-systemd ![](https://i-blog.csdnimg.cn/direct/38faa8ba8c244dbab8343e3f4528a6d1.png) 源码编译安装成功后,安装软件 \[root@localhost php-8.3.9\]# make \&\& make install ![](https://i-blog.csdnimg.cn/direct/5d0e30a3191f43acb53d2526616173ea.png)

相关推荐
羑悻的小杀马特4 分钟前
Docker 容器化部署核心实战:从镜像仓库管理、容器多参数运行到 Nginx 服务配置与正反向代理原理解析
nginx·docker·容器·镜像仓库
NiKo_W8 分钟前
Linux 深入理解权限
linux·运维·服务器
zzywxc78737 分钟前
自动化测试框架是软件测试的核心基础设施,通过预设规则和脚本自动执行测试用例,显著提高测试效率和覆盖率。
运维·人工智能·自动化·prompt·测试用例·流程图
郝学胜-神的一滴1 小时前
深入探索 Python 元组:从基础到高级应用
运维·服务器·开发语言·python·程序人生
CheungChunChiu1 小时前
嵌入式 Linux 启动机制全解析:从 Boot 到 Rootfs
linux·运维·服务器·ubuntu·uboot·boot·extboot
白鹭1 小时前
nginx(介绍+源码安装+平滑升级和回滚)
linux·运维·服务器·nginx·回滚·平滑升级
wanhengidc2 小时前
云手机在办公领域中自动化的应用
运维·智能手机·自动化
知星小度S4 小时前
系统核心解析:深入操作系统内部机制——进程管理与控制指南(一)【进程/PCB】
linux·运维·服务器·进程
技术猿188702783518 小时前
PHP 与 WebAssembly 的 “天然隔阂”
开发语言·php·wasm
码农101号8 小时前
运维安全05 - iptables规则保存与恢复
运维·网络·安全