search
HomeBackend DevelopmentPHP8Detailed explanation of Nginx1.19 php8.0 source code compilation and installation

Recommended study: "PHP8 Tutorial"

##Be prepared for centos7 and above versions

The first step

Download the nginx package and place it in the specified directory. Generally place it in the mnt directory:

Download address: nginx.org/ en/download.html

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

Unzip the nginx compressed package

tar zxvf nginx-1.19.7.tar.gz
Prepare dependency packages:

yum -y install zlib-devel pcre-devel openssl-devel
Prepare nginx users:

useradd -M -s /sbin/nologin nginx
Source code compilation and installation:

./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
Setting configuration file:

user  nginx;
Service management:

1. Detect configuration syntax

/usr/local/nginx/sbin/nginx -t
2. Start service

/usr/local/nginx/sbin/nginx
3. Reload the service

/usr/local/nginx/sbin/nginx -s reload
pkill -HUP nginx
4. Shut down the service

/usr/local/nginx/sbin/nginx -s stop
pkill nginx
5. Start at boot

vi /etc/rc.local/usr/local/nginx/sbin/nginx
Process management:

pstree |grep nginx
ps -ef |grep nginx
ps aux |grep nginx
Port Management:

netstat -tunpl |grep nginx
Client test: (enter your public IP)

http://192.168.2.1
nginx reload

[root@wml sbin]# pkill -HUP nginx

php8.0 Source code compilation and installation

1. Install php8 dependencies

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
2. Install php8 dependency packages

1. Unzip

tar -zxvf oniguruma-6.9.4.tar.gz
2. Switch directories

cd oniguruma-6.9.4/
3 Generate configure

./autogen.sh
4. Generate compilation configuration file

./configure --prefix=/usr
5. Compile and install

make && make install
2. Compile PHP8 main package

1. Unzip

tar xzf php-8.0.0.tar.gz
2. Switch directory

cd php-8.0.0/
3. Generate compilation configuration file

./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. Compile and install

make && make install

error Error encountered during compilation and installation

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

解决办法 yum install automake

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

解决办法 执行 yum install libtool

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

解决办法 参考 下图

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

The above is the detailed content of Detailed explanation of Nginx1.19 php8.0 source code compilation and installation. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:learnku. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool