How to enable PCNTL in Apache

Introduction

Jose Luis
1 min readMay 16, 2022

Hello, in this guide I will teach you how to enable PCNTL in Apache, so you can make things like this.

Note: this module only works on unix system

Let’s Go

  1. First of all we have to create a folder where we are going to store temporary files. In my case I will call it PHPTemp
  2. Download the following file https://www.php.net/distributions/php-7.0.33.tar.gz
  3. Uncompress that file in the previously created folder
  4. Run sudo apt install php7.0-dev to install php-dev so we can use phpize to compile PHP extensions
  5. Go to /ext/pcntl folder
  6. Now run the following command inside /ext/pcntl folder sudo phpize
  7. Excecute the following command’s
  8. sudo ./configure — with-php-config=/usr/bin/php-config
  9. sudo make && sudo make install
  10. If everything works fine the previous command should print something like “Installing shared extensions: /usr/lib/php/20151012/”
  11. Now that we have the bin files of the module, the next thing we should do is to enable this so we can use it in Apache. In order to do this we should excecute the following command: echo "extension=pcntl.so" > /etc/php/7.0/mods-available/pcntl.ini
  12. And that’s all. We’ll need to restart Apache and the module should be available

Note: This guide can change depending on the Linux distribution and PHP Version.

--

--