搜索
首页后端开发PHP8详解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 源码编译安装的详细内容。更多信息请关注PHP中文网其他相关文章!

声明
本文转载于:learnku。如有侵权,请联系admin@php.cn删除

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

SecLists

SecLists

SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )专业的PHP集成开发工具

WebStorm Mac版

WebStorm Mac版

好用的JavaScript开发工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中