您的签名有问题,我们是使用safebase64编码,你可以参考我们的源码
https://github.com/qiniu/php-sdk/blob/a864511adb2e50b2b0f080440e6f11d6989905ec/src/Qiniu/functions.php
URL 安全的 Base64 编码适用于以 URL 方式传递 Base64 编码结果的场景。该编码方式的基本过程是先将内容以 Base64 格式编码为字符串,然后检查该结果字符串,将字符串中的加号+换成中划线-,并且将斜杠/换成下划线_,同时尾部保持填充等号=。
/**
对提供的数据进行 urlsafe 的 base64 编码。
*
@param string $data 待编码的数据,一般为字符串
*
@return string 编码后的字符串
@link http://developer.qiniu.com/docs/v6/api/overview/appendix.html#urlsafe-base64
*/
base64_urlSafeEncode($data)
{
$find = array('+', '/');
$replace = array('-', '_');
return str_replace($find, $replace, base64_encode($data));
}
/**