Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Help installing php extension PCNTL
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Help installing php extension PCNTL

Hi, does anybody know how to install this php extension called pcntl on ubuntu/debian?

I need it to use a github repo which allows me to create async functions in php.

Comments

  • I've tried to do so but failed, I can pay if someone help installing it

  • Maybe I will compile bullseye packages later this week. Which PHP version you are looking for?

  • CharlieCCharlieC Member
    edited June 2022

    Any above 7.0 is fine, thank you

  • noamannoaman Member
    edited June 2022

    There is a high chance that pcntl is installed but its functions are in disabled_functions in php.ini.

    Can you run this command real quick?

    php -i | grep pcntl

    Thanked by 1FrankZ
  • CharlieCCharlieC Member
    edited June 2022

    @noaman said:
    There is a high chance that pcntl is installed but its functions are in disabled_functions in php.ini.

    Can you run this command real quick?

    php -i | grep pcntl

    root@vm:/var/www/html/async# php -i | grep pcntl
    pcntl
    pcntl support => enabled

    I've removed "disabled_functions" line from php.ini file and restarted both php and nginx, still the script tells me "The pcntl functions cannot be found. Is the pcntl extension installed?"

  • liujialiujia Member

    @CharlieC said:

    @noaman said:
    There is a high chance that pcntl is installed but its functions are in disabled_functions in php.ini.

    Can you run this command real quick?

    php -i | grep pcntl

    root@vm:/var/www/html/async# php -i | grep pcntl
    pcntl
    pcntl support => enabled

    I've removed "disabled_functions" line from php.ini file and restarted both php and nginx, still the script tells me "The pcntl functions cannot be found. Is the pcntl extension installed?"

    Hi, which script you used to test if pcntl functions? Maybe I will try to test on my local debian box.

  • Hi, which script you used to test if pcntl functions? Maybe I will try to test on my local debian box.

    https://github.com/superrbstudio/async

    if you don't know how to install I can help its very simple

    thank you :)

  • liujialiujia Member

    @CharlieC said:

    Hi, which script you used to test if pcntl functions? Maybe I will try to test on my local debian box.

    https://github.com/superrbstudio/async

    if you don't know how to install I can help its very simple

    thank you :)

    Oh...yes, I need your help, because I do not know about php programing.

    I put files from src directory to apache htdocs path, browsing helpers.php, it just show blank. I also try to copy 'Getting Started' example to test, but it show error - Fatal error: Uncaught Error: Call to undefined function async() in...

    :D

  • Oh...yes, I need your help, because I do not know about php programing.

    Sent you a dm

    If anyone else has solutions let me know :)

  • noamannoaman Member

    @CharlieC said:

    @noaman said:
    There is a high chance that pcntl is installed but its functions are in disabled_functions in php.ini.

    Can you run this command real quick?

    php -i | grep pcntl

    root@vm:/var/www/html/async# php -i | grep pcntl
    pcntl
    pcntl support => enabled

    I've removed "disabled_functions" line from php.ini file and restarted both php and nginx, still the script tells me "The pcntl functions cannot be found. Is the pcntl extension installed?"

    I think i have to set it up to see what's causing the issue.

    There is a high chance that your php.ini of cli and php-fpm are different.

    You are modifying CLI version but expecting changes in php-fpm using nginx.

    Could you confirm by creating a phpinfo.php file with a simple phpinfo function in www webroot and hitting it from web?

    It would display if pcntl is really loaded or not

    Thanked by 1liujia
  • CharlieCCharlieC Member
    edited June 2022

    Hmm seeing this I think its not loaded somehow
    https://i.imgur.com/QzdyYA9.png

    But I have edited both cli and fpm ini files.

    It would display if pcntl is really loaded or not

  • I can pay if anyone is able to install it for me :(

  • noamannoaman Member

    @CharlieC said:
    Hmm seeing this I think its not loaded somehow
    https://i.imgur.com/QzdyYA9.png

    But I have edited both cli and fpm ini files.

    It would display if pcntl is really loaded or not

    Which php ini did you change?

    Also you can pm me any desk details and we both can figure it out ☺️

  • liujialiujia Member

    @CharlieC said:

    Oh...yes, I need your help, because I do not know about php programing.

    Sent you a dm

    If anyone else has solutions let me know :)

    noaman is right.

    In my local debian php7.4 box, php cli is okay, but apache2 not, script said:
    Fatal error: Uncaught RuntimeException: The pcntl functions cannot be found. Is the pcntl extension installed? in /var/www/magen2/vendor/superrb/async/src/Superrb/Async/Handler.php:75

    But when I did as rainysia said on https://stackoverflow.com/questions/14096130/enable-pcntl-in-ubuntu-php-test-fails

    apache2 can show 'pcntl support' now, script show another error as php cli:
    Fatal error: Uncaught TypeError: Argument 1 passed to Superrb\Async\Socket::__construct() must be an instance of Socket, resource given, called in /var/www/magen2/vendor/superrb/async/src/Superrb/Async/Channel.php on line 52

    So, maybe have to create pcntl.so using phpize(php7.4-dev), then load it for apache2.

  • Yes @noaman helped me solve the issue, it is resolved now thanks

  • noamannoaman Member

    @CharlieC said:
    Yes @noaman helped me solve the issue, it is resolved now thanks

    You are welcome :smile:

Sign In or Register to comment.