If you have installed a new Apache and a new version of PHP, you can migrate to the new Apache with the configurations of the old one via Apache→version.
For me CURL worked with PHP7.4 but not the other versions, then by migrating to the new Apache with the migration of data from the old Apache it worked.