phpasynchronousphp-extensionswooleopenswoole

Unable to install openswoole extension in php 8.3.6


I am trying to built and extension of openswoole from more than 13 hours but getting the same error again and again.

PHP Warning:  PHP Startup: Unable to load dynamic library
 'openswoole.so' (tried: /usr/lib/php/20230831/openswoole.so 
(/usr/lib/php/20230831/openswoole.so: undefined symbol: curl_ce), 
/usr/lib/php/20230831/openswoole.so.so 
(/usr/lib/php/20230831/openswoole.so.so: cannot open shared object
 file: No such file or directory)) in Unknown on line 0

I have verified that I have all the necessary extension like libcurl, openssl everything is already installed but openswoole is not becoming available. I added this line at the last of my php.ini file.

extension=openswoole.so

I am installing this in my ubuntu cloud digital ocean. Here is a detail of php and sytem

PHP Version 8.3.6

Linux ubuntu-s-1vcpu-2gb-amd-lon1-01 6.8.0-36-generic #36-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 10 10:49:14 UTC 2024 x86_64

Solution

  • The problem is that when you add a line at the end of php.ini for enabling php extension.

    extension=openswoole.so
    

    It doesn't load in the correct order hence you should remove the line extension=openswoole.so from php ini configuration and enable the extension with

    sudo phpenmod openswoole
    

    then restart your server, For apache

    sudo systemctl restart apache2  # For Apache
    

    and verify installation with

    php -m | grep openswoole
    

    It should return openswoole. I found the solution for this error here