0

I updated my curl to work on https. It does work on terminal however when I use cUrl in php it doesn't work for any https based url.

The error code i get is 77. I have looked into other solutions but no solution is working at all.

I have already tried adding verifyHost, SSL v 6, return transfer nothing works

A simple code is

$ch = curl_init("https://www.google.com");

        $response = curl_exec($ch);

        $error = curl_error($ch);
        $number = curl_errno($ch);

        curl_close($ch);

        $response = array(
            'Result' => array(
                'error'=> $error,
                'number' => $number,
                //'message'=>$fields,
                'count'=> $response
            ));
        $this->jsonOutput($response);  

In terminal curl https://www.google.com works fine.

What is going on, the curl in php was working just fine before.

Muhammad Umar
  • 11,391
  • 21
  • 91
  • 193

1 Answers1

1

As you are using yum, i assume you are working on a CentOS distro.

I have made a brief research and it seems it could be an issues with the NSS centos package, triggered by your yum update. You could try some basic process restart.

Try to restart your httpd service:

service httpd restart

Or via apache:

apachectl stop
apachectl start

and your php-fpm

sudo service php-fpm restart
Andrea Golin
  • 3,259
  • 1
  • 17
  • 23