PHP 5.4 and 7.5 both give me this error on my server. openssl_sign() expects parameter 4 to be long, string given. Current documentation for PHP says parameter 4 should be int or string. I see this issue throughout stack overflow, but no solutions. Any workarounds for the SSL creation or is there some secret PHP fix. The line openssl_sign("$header.$claims", $signature, $pkey,‘sha256’); is the problem. I’ve tried the OPENSSL_ALGO_SHA256 value also, with the same error. I’ve gotten everything else working in the book and on my iPhone physical device.