r/PHPhelp • u/Same_Development1120 • Jun 26 '26
Composer installation fails with "certificate verify failed" PHP beginner
Hi everyone,
I’m a beginner in PHP and I’m currently trying to install Composer on Windows with WampServer.
I keep getting an SSL certificate verification error during the installation (certificate verify failed / Failed to enable crypto), and I’m not sure how to fix it.
I’ve already checked my php.ini file, but as a beginner I may be missing something important.
Could anyone help me understand what’s causing this issue and how to solve it? Any simple explanation would be greatly appreciated.
Thank you in advance!
4
Upvotes
2
u/Katro94 Jun 26 '26
Try disable antivirus.
https://stackoverflow.com/questions/41164321/cant-install-composer-due-to-certificate-issues
1
u/martinbean Jun 26 '26
Haven’t developed with Windows for over a decade but seem to remember there was an issue with the SSL certificates Windows shipped with that were untrusted when it came to Composer.
How are you trying to run Composer? Through the regular Windows command prompt? Maybe try a WSL prompt if you aren’t/haven’t already.
2
u/Mindless_Compote_468 Jun 26 '26
السلام عليكم ورحمة الله تعالى وبركاته
Hey! I had the exact same issue with XAMPP a while back, so I know how frustrating it is for a beginner.
The problem is that PHP doesn't have a proper CA certificate file set up, so it can't verify SSL connections (which Composer needs).
Here's how I fixed it:
curl.cainfo = "C:\xampp\php\cacert.pem"
openssl.cafile = "C:\xampp\php\cacert.pem"
4. Restart Apache from the XAMPP Control Panel
5. Try installing Composer again
This should solve the certificate verify failed error completely. Let me know if it works for you, happy to help if you get stuck on anything else!
2
u/equilni Jun 27 '26
Per the docs:
https://getcomposer.org/doc/articles/troubleshooting.md#ssl-certificate-problem-unable-to-get-local-issuer-certificate
Further in the github issues, which is similar to the SO link posted:
https://github.com/composer/composer/issues/12336
1
u/LeftPick6290 Jun 27 '26
Does anyone know why Instagram suspend account without any reason? Without giving me any notice..
0
u/[deleted] Jul 23 '26
[deleted] — view deleted comment