PHP Call Wget Command

PHP Call Wget Command

In my PHP code, I am using system command to download files as follow:
$wgetCmd = "wget --no-check-certificate -nv -O " . $this->storageLocal . "{$outputFileName}-downloading.xml {$url}";
if (system($wgetCmd) != 0) {
    $success = false;
    return $success;
}

In some situation, I get this error message without “—no-check-certificate"
Wget error: ERROR: The certificate of is not trusted / Skipping ssl/tls certificate checks with wget

The fix is add the parameter to wget command.

references:
https://forum.ivorde.com/wget-error-error-the-certificate-of-is-not-trusted-t19611.html

猜你喜欢

转载自sillycat.iteye.com/blog/2365629