简体   繁体   中英

cURL error 60 - SSL certificate problem - unable to get local issuer

PHP version: 5.6

Problem: I get an error:

    cURL error 60: SSL certificate problem: unable to get local issuer certificate.

Steps I tried to solve this issue:

  • php -r "readfile('https://symfony.com/installer');" > symfony

    1. Download a file with the updated list of certificates from https://curl.haxx.se/ca/cacert.pem .

    2. Set path in php.ini curl.cainfo =D:\\xampp_tomact\\php\\extras\\ssl\\cacert.pem openssl.cafile=D:\\xampp_tomact\\php\\extras\\ssl\\cacert.pem

    3. Apache restart

    4. Then I tried with

      php symfony new my_project_name

I have taken help from links

http://symfony.com/doc/current/setup.html

cURL error 60: SSL certificate: unable to get local issuer certificate

But none of the solution worked in xampp windows.
Please suggest

Steps I tried again

  1. d:\\xampp\\htdocs> php -r "readfile('http://symfony.com/installer');" > symfony
  2. d:\\xampp\\htdocs\\projects> php symfony
  3. symfony new my_project_name .

Error after executing the third command above:

    cURL error 60: SSL certificate problem: unable to get local issuer 

Still no solution for this bug while installing symfony.

I also followed symfony docs

Symfony 文档图片

CMD命令图片

Last solution I also tried:

PHP - SSL certificate error: unable to get local issuer certificate

But it also did not work.

 xampp version 3.2.2

After lots of struggle I found why symfony cannot be downloaded

  1. XAMPP version 3.2.2 downgraded XAMPP vr 3.2.1
  2. Download cacert.pem file from https://curl.haxx.se/ca/cacert.pem .
  3. php.ini line 989 put this curl.cainfo ="D:\\xamppNew\\php\\extras\\ssl\\cacert.pem"
  4. Restart apachae again.
  5. Message: symfony is being downloaded .

In my case xampp 3.2.2 was creating problem. So beware from XAMPP 3.2.2. It has some bugs which apache should fix.

Finally I can say this was xampp problem ie new version in which tomcat is installed.

user@DESKTOP-HE0OTN5 MINGW64 /c/xampp/htdocs/symphart
$ composer diagnose
You are running Composer with SSL/TLS protection disabled.
Checking composer.json: WARNING
require.composer/package-versions-deprecated : exact version constraints (1.11.99.1) should be avoided if the package follows semantic versioning<br>  
Checking platform settings: OK
Checking git settings: OK 
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: unable to get local issuer certificate
Composer is configured to disable SSL/TLS protection. This will leave remote HTTPS requests vulnerable to Man-In-The-Middle attacks.
Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: unable to get local issuer certificate
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: Warning: Accessing getcomposer.org over http which is an insecure protocol.
OK
Composer version: 2.0.12
PHP version: 7.4.16
PHP binary path: C:\Program Files\php-7.4.16\php.exe
OpenSSL version: OpenSSL 1.1.1i  8 Dec 2020
cURL version: 7.70.0 libz 1.2.11 ssl OpenSSL/1.1.1i
zip: extension present, unzip present<br>

If you are running with this issue i can help you....

You just need to remove some line of code from your composer.json file of your project file from c:\\xampp\\htdocs\\symphart(yourProjectFile)

 "config": {
        "optimize-autoloader": true,
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true,
        "disable-tls": true, 
        "secure-http": false  

You just need to remove this two line of code from your composer.json file And you'll find this result

user@DESKTOP-HE0OTN5 MINGW64 /c/xampp/htdocs/symphart
$ composer diagnose
Checking composer.json: WARNING
require.composer/package-versions-deprecated : exact version constraints (1.11.99.1) should be avoided if the package follows semantic versioning
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.0.12
PHP version: 7.4.16
PHP binary path: C:\Program Files\php-7.4.16\php.exe
OpenSSL version: OpenSSL 1.1.1i  8 Dec 2020
cURL version: 7.70.0 libz 1.2.11 ssl OpenSSL/1.1.1i
zip: extension present, unzip present

If you are ok with it you can try this out

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM