How to enable PCNTL in Ubuntu Server 22.04 LTS with HestiaCP 1.8.12 + PHP 8.2.24

CÓMO HABILITAR PCNTL EN UBUNTU SERVER 22.04 CON HESTIACP 1.8.12 Y PHP 8.2.24

PASO 1

ejecutar comando:

php -v

resultado: PHP 8.2.24

PASO 2

ejecutar comando:

cd /root && mkdir pcntl && cd pcntl

ejecutar comando:

wget https://www.php.net/distributions/php-8.2.24.tar.gz

PASO 3

ejecutar comando:

sudo tar xfz php-8.2.24.tar.gz && sudo rm -rf php-8.2.24.tar.gz

ejecutar comando:

cd php-8.2.24/ext/pcntl/

PASO 4:

  • Instalar PHPIZE:

sudo apt install php8.2-dev -y

  • Luego ejecutar el comando:

sudo phpize

PASO 5

  • Ejecutar el comando:

sudo ./configure --with-php-config=/usr/bin/php-config

PASO 6

  • Ejecutar el comando:

sudo make && sudo make install

El resultado debe ser algo como este:

Installing shared extensions: /usr/lib/php/20190902/

PASO 7

  • Ejecutar los siguientes comandos:

cd ..
cd ..
cd ..
sudo rm -rf php-8.2.24

PASO 9

  • Ejecutar el comando:

cd /etc/php/8.2

PASO 10

  • Ejecutar el comando:

nano /mods-available/pcntl.ini

Agregar el texto ‘extension=pcntl.so’ (sin las comillas) dentro del archivo abierto en nano, luego guardarlo y cerrarlo

PASO 11

  • Ejecutar el comando:

nano /fpm/php.ini

PASO 12: Buscar y comentar la siguiente línea (poniendo ; al inicio):

disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig

luego agregar la siguiente línea a continuación de la anterior:

disable_functions =

luego agregar la siguiente extension en la zona de “Dynamics Extensions”:

extension=pcntl

luego guardar el archivo con CTRL + X + Y + ENTER

PASO 13: reiniciar el servicio apache2 con el comando:

sudo service apache2 restart

PASO 14: reiniciar el servicio php8.2-fpm con el comando:

sudo service php8.2-fpm restart

Comprobar que PCNTL está activo en la CLI, con el siguiente comando:

php -i | grep pcntl

  • El resultado del comando debe ser algo como esto:
pcntl
pcntl support => enabled	(el módulo PCNTL está activado)

Listo !!!

1 Like