According to your needs, the solution for me was to use the following tutorial from HowToForge.
Today, current release is 7.4.11
, but you can change it.
cd /tmp
wget https://www.php.net/distributions/php-7.4.11.tar.gz
tar xfz php-7.4.11.tar.gz
cd php-7.4.11
On the next you will find --enable-pcntl
what is the interesting thing.
./configure --prefix=/opt/php-7.4 --with-pdo-pgsql --with-zlib-dir --with-freetype --enable-mbstring --enable-soap --enable-calendar --with-curl --with-zlib --enable-gd --with-pgsql --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --enable-exif --enable-bcmath --with-mhash --with-zip --with-pdo-mysql --with-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-jpeg --with-openssl --with-fpm-user=www-data --with-fpm-group=www-data --with-libdir=/lib/x86_64-linux-gnu --enable-ftp --with-imap --with-imap-ssl --with-kerberos --with-gettext --with-xmlrpc --with-xsl --enable-opcache --enable-intl --with-pear --enable-fpm
Please follow the entire tutorial for a complete working solution here :
https://www.howtoforge.com/tutorial/how-to-compile-and-install-php-7.4-on-ubuntu-18-04/