cURL not working for https giving 77 error in php











up vote
0
down vote

favorite












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.










share|improve this question






















  • The question does not look the same, but I think this can help you: stackoverflow.com/questions/17064601/…
    – Koen Hollander
    Nov 8 at 9:59










  • Do you have multiple versions of php running on your server?
    – Andrea Golin
    Nov 8 at 10:02










  • No just one. It was working fine but to install mongodb, I did yum update curl.
    – Muhammad Umar
    Nov 8 at 10:03












  • try to run a curl --version, what version did you get?
    – Andrea Golin
    Nov 8 at 10:08










  • version is curl 7.29.0
    – Muhammad Umar
    Nov 8 at 10:09















up vote
0
down vote

favorite












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.










share|improve this question






















  • The question does not look the same, but I think this can help you: stackoverflow.com/questions/17064601/…
    – Koen Hollander
    Nov 8 at 9:59










  • Do you have multiple versions of php running on your server?
    – Andrea Golin
    Nov 8 at 10:02










  • No just one. It was working fine but to install mongodb, I did yum update curl.
    – Muhammad Umar
    Nov 8 at 10:03












  • try to run a curl --version, what version did you get?
    – Andrea Golin
    Nov 8 at 10:08










  • version is curl 7.29.0
    – Muhammad Umar
    Nov 8 at 10:09













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.










share|improve this question













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.







php curl






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 9:53









Muhammad Umar

5,4001564141




5,4001564141












  • The question does not look the same, but I think this can help you: stackoverflow.com/questions/17064601/…
    – Koen Hollander
    Nov 8 at 9:59










  • Do you have multiple versions of php running on your server?
    – Andrea Golin
    Nov 8 at 10:02










  • No just one. It was working fine but to install mongodb, I did yum update curl.
    – Muhammad Umar
    Nov 8 at 10:03












  • try to run a curl --version, what version did you get?
    – Andrea Golin
    Nov 8 at 10:08










  • version is curl 7.29.0
    – Muhammad Umar
    Nov 8 at 10:09


















  • The question does not look the same, but I think this can help you: stackoverflow.com/questions/17064601/…
    – Koen Hollander
    Nov 8 at 9:59










  • Do you have multiple versions of php running on your server?
    – Andrea Golin
    Nov 8 at 10:02










  • No just one. It was working fine but to install mongodb, I did yum update curl.
    – Muhammad Umar
    Nov 8 at 10:03












  • try to run a curl --version, what version did you get?
    – Andrea Golin
    Nov 8 at 10:08










  • version is curl 7.29.0
    – Muhammad Umar
    Nov 8 at 10:09
















The question does not look the same, but I think this can help you: stackoverflow.com/questions/17064601/…
– Koen Hollander
Nov 8 at 9:59




The question does not look the same, but I think this can help you: stackoverflow.com/questions/17064601/…
– Koen Hollander
Nov 8 at 9:59












Do you have multiple versions of php running on your server?
– Andrea Golin
Nov 8 at 10:02




Do you have multiple versions of php running on your server?
– Andrea Golin
Nov 8 at 10:02












No just one. It was working fine but to install mongodb, I did yum update curl.
– Muhammad Umar
Nov 8 at 10:03






No just one. It was working fine but to install mongodb, I did yum update curl.
– Muhammad Umar
Nov 8 at 10:03














try to run a curl --version, what version did you get?
– Andrea Golin
Nov 8 at 10:08




try to run a curl --version, what version did you get?
– Andrea Golin
Nov 8 at 10:08












version is curl 7.29.0
– Muhammad Umar
Nov 8 at 10:09




version is curl 7.29.0
– Muhammad Umar
Nov 8 at 10:09












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










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





share|improve this answer





















  • ..................................... sudo reboot did it ...... Thanks so much
    – Muhammad Umar
    Nov 8 at 14:50













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53205237%2fcurl-not-working-for-https-giving-77-error-in-php%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










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





share|improve this answer





















  • ..................................... sudo reboot did it ...... Thanks so much
    – Muhammad Umar
    Nov 8 at 14:50

















up vote
1
down vote



accepted










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





share|improve this answer





















  • ..................................... sudo reboot did it ...... Thanks so much
    – Muhammad Umar
    Nov 8 at 14:50















up vote
1
down vote



accepted







up vote
1
down vote



accepted






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





share|improve this answer












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






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 8 at 10:26









Andrea Golin

650314




650314












  • ..................................... sudo reboot did it ...... Thanks so much
    – Muhammad Umar
    Nov 8 at 14:50




















  • ..................................... sudo reboot did it ...... Thanks so much
    – Muhammad Umar
    Nov 8 at 14:50


















..................................... sudo reboot did it ...... Thanks so much
– Muhammad Umar
Nov 8 at 14:50






..................................... sudo reboot did it ...... Thanks so much
– Muhammad Umar
Nov 8 at 14:50




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53205237%2fcurl-not-working-for-https-giving-77-error-in-php%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Schultheiß

Liste der Kulturdenkmale in Wilsdruff

Android Play Services Check