I have exactly the same problem, I compile with the extension, in phpinfo() if my module (openssl, curl, etc) is there, I enable it (extension=openssl) in php.ini restart apache and it shows me the following error message
PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /opt/alt/php72/usr/lib/php/extensions/no-debug-non-zts-20170718/curl (/opt/alt/php72/usr/lib/php/extensions/no-debug-non-zts-20170718/curl: cannot open shared object file: No such file or directory), /opt/alt/php72/usr/lib/php/extensions/no-debug-non-zts-20170718/curl.so (/opt/alt/php72/usr/lib/php/extensions/no-debug-non-zts-20170718/curl.so: cannot open shared object file: No such file or directory))) in Unknown on line 0, referer: https://localhost/index.php
This is repeated with any extension I can undo and looking in that folder of extensions I only see about 8 like imagick, opcache, etc. but none of the ones I undo... so what did I miss because I can't find the file "curl.so" anywhere.