How to Enable PCNTL on Ubuntu Bionic 18.04.3 LTS with PHP 7.2.24

crarchile

New Member
This tutorial has been tested under the following environment:

VPS: 1 GB Ram, 20 GB SSD, 1 CPU Core x86_64
OS: Ubuntu Bionic 18.04.3 / x86_64
Web Control Panel: VestaCP 0.9.8.26
Mailwizz: 1.8.7

# Step 1: We need to Install VestaCP control panel on your Mailwizz VPS (www.vestacp.com)

# command 1:
apt-get update

# Command 2:
curl -O http://vestacp.com/pub/vst-install.sh

# Command 3:
bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin no --clamav no --softaculous no --mysql yes --postgresql no --hostname your.host.name --email your@ema.il --password your-password --force yes

# Note 1:
When you be asked about if you want to proceed with Vesta install, press Y and then press the Enter Key

# Note 2:
When you be asked if you want to replace the file '/etc/sudoers' , only answer Y and then press the Enter key

# Note 3:
You must change your.host.name for your own FQDN like yourserver.yourdomain.com

# Note 4:
You must change your@ema.il for your own real e-mail

# Note 5:
You must change your-password for your own real password

# Step 2: Reboot your VPS

# Command 1:

reboot

# Step 3: Check actual PHP version & Install PHP Development Tools

# Command 1: check your installed PHP version. It must be 7.2.24 (it is the PHP version installed for vestacp in Ubuntu Bionic 18.04.3 )

php -v

# Command 2: install development tools

apt-get install php7.2-dev –y

# Step 4: Download PHP 7.2.24 sources

# Command 1:

cd /tmp

# Command 2:

wget http://php.net/distributions/php-7.2.24.tar.gz

# Step 5: Untar the source file of PHP 7.2.24

# Command 1:

tar zxvf php-7.2.24.tar.gz

# Step 6: Compile the PCNTL module

# Command 1:

cd php-7.2.24/ext/pcntl

# Command 2:

phpize

# Command 3:

./configure

# Command 4:

make

# Step 7: We copy the PCNTL module from the modules directory to the working PHP directory

# Command 1:

cd modules

# Command 2:

cp pcntl.so /usr/lib/php/20170718

# Step 8: We create the pcntl.ini file using the nano editor

# Command 1:

nano /etc/php/7.2/mods-available/pcntl.ini

# We need to put the following line inside the file:

extension=pcntl.so

# then we need to save & close the file using CTRL + X + Y + Enter

# Step 9: We need to create a Simbolic Link to the file pcntl.ini created on previous step

# Command 1:

cd /etc/php/7.2/apache2/conf.d

# Command 2:

ln -s /etc/php/7.2/mods-available/pcntl.ini 20-pcntl.ini

# Step 10: We need to edit the file /etc/php/7.2/apache2/php.ini to comment the line "disable_functions"

# Command 1:

nano /etc/php/7.2/apache2/php.ini

# Using CTRL + W command inside the NANO editor, we need to find the line starting with "disable_functions" and change it to ";disable_functions"

# Now we must save and close Nano using : CTRL + X + Y + Enter

# Step 11: We need to install the PHP-ZIP complement for PHP

# Command 1:

apt install zip unzip php7.2-zip

# Step 12: We now must restart the Apache2 service and the Vesta service

# Command 1:

service apache2 restart && service vesta restart

# Step 13: Now we can check if PCNTL module was enabled. We can check it from inside the Mailwizz Backend , entering to the following URL:

https://your-mailwizz-domain/backend/index.php/misc/phpinfo

# At this point you can search "pcntl" on that page by using CTRL + F command at your browser and be sure that PCNTL module is being listed enabled.
 
Last edited:
Back
Top