php - Error with curl comand in localhost with a https protocol -


i'm trying run exec() function in php passing command curl -o downloading file hosted on dropbox. think need ssl key because when run code locally via terminal able file when executed on server curl: (60) ssl certificate problem: unable local issuer certificate.

i'm running server on localhost in xampp. execute curl via php.ini. can download file on http, not https.

an example of code this:

$url = 'https://dl.dropboxusercontent.com/1/view/fs0q6a9y8sy8z1u/newfile.c'; $command = "cd ".dirname(__file__)." 2>&1; cd ../../plugins 2>&1; cd ../../codiad 2>&1; cd workspace/studente 2>&1";    echo $command;  $method1 = exec($command);  $command = "curl -o ".$url." 2>&1";   $method1 = exec($command);  echo $command; 

$url example file on dropbox.

the full error output:

curl: (60) ssl certificate problem: unable local issuer certificate more details here: http://curl.haxx.se/docs/sslcerts.html  curl performs ssl certificate verification default, using "bundle"  of certificate authority (ca) public keys (ca certs). if default  bundle file isn't adequate, can specify alternate file  using --cacert option. if https server uses certificate signed ca represented in  bundle, certificate verification failed due  problem certificate (it might expired, or name might  not match domain name in url). if you'd turn off curl's verification of certificate, use  -k (or --insecure) option. 

as mentioned, think need ssl key because running in local terminal file.


Comments