# Chapter 6: PHP code yields openssl\_sign() error

**URL:** <https://forums.kodeco.com/t/chapter-6-php-code-yields-openssl-sign-error/126311>\
**Category:** Push Notifications by Tutorials\
**Created:** [December 2, 2020, 4:01am UTC](https://forums.kodeco.com/t/chapter-6-php-code-yields-openssl-sign-error/126311 "2020-12-02T04:01:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathaniel29651](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/nathaniel29651/32/105896_2.png) [@nathaniel29651](https://forums.kodeco.com/u/nathaniel29651)\
**Post date:** [December 2, 2020, 4:01am UTC](https://forums.kodeco.com/t/chapter-6-php-code-yields-openssl-sign-error/126311/1 "2020-12-02T04:01:07Z")

</div>

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.
