RUN pecl install mongodb-1.4.2
Resulted in this output:
RUN pecl install mongodb-1.4.2 && docker-php-ext-enable mongodb:
No releases available for package "pecl.php.net/mongodb"
install failed
Could this be a cert issue? because if I try to wget i get following:
Connecting to pecl.php.net (104.236.228.160:443)
ssl_client: pecl.php.net: certificate verification failed: certificate has expired
PHP Version
php:7.0
Is there a way to fix this or do I need to just wait for them to update the cert?
2
Answers
Your base image is too old and doesn’t have the appropriate certificate information, and
apk update && apk upgrade
don’t get you there. I don’t see any way to tell pecl to ignore certs but you could do:Of course, I’d have recommend not using such old versions and then it won’t be a problem.
I was able to solve this by removing the offending certificate from the docker image. I’m also on a situation where I cannot upgrade the PHP version and I need timezonedb always up-to-date from PECL.
After removing them PECL works normally.
Read https://github.com/libressl/portable/issues/692#issuecomment-937800309 lead to https://github.com/openbsd/src/commit/3c95f6f12797ebbdedb8d5f712eb65bd04fe233a
I then made a grep to see where the cert was on my docker image (php5.6-alpine) and removed it.
Two files required a patch, and two files were the whole certificate.
Patch
/etc/ssl/certs/ca-certificates.crt
Patch
/etc/ssl/cert.pem
Then remove the other two files which are the whole cert
/etc/ssl/certs/2e5ac55d.0
and/etc/ssl/certs/ca-cert-DST_Root_CA_X3.pem
These are the final dockerfile lines, I left the grep line intentionally to debug this if some file is renamed
PS: Originally from https://github.com/php/php-src/issues/11486#issuecomment-1626075999 answering here too just in case.