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 Unzip the nginx compressed packagetar zxvf nginx-1.19.7.tar.gz
yum -y install zlib-devel pcre-devel openssl-devel
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. Detect configuration syntax
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx -s reload pkill -HUP nginx
/usr/local/nginx/sbin/nginx -s stop pkill nginx
vi /etc/rc.local/usr/local/nginx/sbin/nginx
pstree |grep nginx ps -ef |grep nginx ps aux |grep nginx
netstat -tunpl |grep nginx
http://192.168.2.1
[root@wml sbin]# pkill -HUP nginx
php8.0 Source code compilation and installation
1. Install php8 dependenciesyum -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
tar -zxvf oniguruma-6.9.4.tar.gz
cd oniguruma-6.9.4/
./autogen.sh
./configure --prefix=/usr
make && make install
1. Unzip
tar xzf php-8.0.0.tar.gz
cd php-8.0.0/
./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
make && make install
error Error encountered during compilation and installation
解决办法 yum install automake
解决办法 执行 yum install libtool
解决办法 参考 下图
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!