9951 explained code solutions for 126 technologies


php-pcntlHow to check if PCNTL is enabled in PHP?


To check if PCNTL is enabled in PHP, you can use the phpinfo() function. This will output information about the current PHP installation, including whether PCNTL is enabled.

<?php
phpinfo();

Output example

...
pcntl

PCNTL Support => enabled
...

Alternatively, you can use the php -m command to list all the modules that are enabled in the current PHP installation. If PCNTL is enabled, it will be listed in the output.

$ php -m
[PHP Modules]
...
pcntl
...

Helpful links

Edit this code on GitHub