PHP 7.4.11编译安装(Debian 10 环境)

#配置编译参数

./configure --prefix=/usr/local/php7411 --disable-all \
--build=x86_64-debian10-linux-gnu --enable-cli --enable-fpm \
--with-fpm-user=www --with-fpm-group=www --with-fpm-systemd \
--with-fpm-acl --with-config-file-path=/usr/local/php/etc \
--with-config-file-scan-dir=/usr/local/php/etc/conf.d --with-layout=PHP \
--with-libxml --with-openssl=shared --with-pcre-jit --with-sqlite3=shared \
--with-zlib --enable-bcmath --enable-calendar --with-curl=shared \
--enable-dom --enable-ftp=shared --enable-gd=shared --enable-exif=shared \
--enable-session --enable-soap=shared --enable-sockets=shared --enable-phar=shared \
--enable-posix --enable-tokenizer --enable-xml --enable-xmlreader --enable-xmlwriter \
--with-zip=shared --with-tsrm-pthreads --enable-mbstring=shared --enable-mbregex \
--enable-intl=shared --with-gettext=shared --with-iconv=shared \
--enable-opcache=shared --enable-huge-code-pages=shared --enable-pcntl=shared \
--with-mysqli=shared --with-mysql-sock --enable-json --enable-pdo \
--with-pdo-mysql=shared --with-sodium=shared --with-libedit=shared \
--with-pdo-sqlite=shared build_alias=x86_64-debian10-linux-gnu \
--enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-expat=shared \
--with-xmlrpc=shared --with-xsl=shared --with-gmp=shared --with-mhash \
--with-enchant=shared --enable-ctype --with-pspell \
--enable-shmop=shared --with-snmp=shared --enable-simplexml \
--enable-mysqlnd=shared --enable-fileinfo --with-ldap=shared \
--with-bz2=shared --enable-filter

nginx systemd service file

[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
#PIDFile=/run/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload -c /usr/local/nginx/conf/nginx.conf
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true

[Install]
WantedBy=multi-user.target

nginx 1.18.0 编译安装(Debian 10环境)

#下载nginx 1.18.0源码

wget https://nginx.org/download/nginx-1.18.0.tar.gz

#解压源码包

tar xf nginx-1.18.0.tar.gz

#配置编译参数

cd nginx-1.18.0
./configure --prefix=/usr/local/nginx1180 --user=www --group=www \
--build=x86_64-debian10-linux-gnu --with-select_module \
--with-poll_module --with-threads --with-file-aio \
--with-http_ssl_module --with-http_v2_module --with-http_realip_module \
--with-http_addition_module --with-http_xslt_module=dynamic \
--with-http_image_filter_module=dynamic \
--with-http_geoip_module=dynamic --with-http_sub_module \
--with-http_dav_module --with-http_flv_module \
--with-http_mp4_module --with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_auth_request_module \
--with-http_random_index_module --with-http_secure_link_module \
--with-http_degradation_module --with-http_slice_module \
--with-http_stub_status_module \
--with-http_perl_module=dynamic --with-mail=dynamic \
--with-mail_ssl_module --with-stream=dynamic \
--with-stream_ssl_module --with-stream_realip_module \
--with-stream_geoip_module=dynamic \
--with-stream_ssl_preread_module --with-google_perftools_module \
--with-pcre --with-pcre-jit --with-libatomic

#编译并安装

make
sudo make install