Group Group Group Group Group Group Group Group Group

Issues runnning php script


#1

Hi! I am getting trouble running php script.
I am getting several warnings such as:
Warning: A non-numeric value encountered in /Users/miguel/Desktop/sendPushes.php on line 2
line 2: const AUTH_KEY_PATH = ‘/Users/miguel/Desktop/AuthKey_0000000000.p8’;

Warning: openssl_sign(): supplied key param cannot be coerced into a private key in /Users/miguel/Desktop/sendPushes.php on line 41
line 40: $pkey = openssl_pkey_get_private(‘file://’ . AUTH_KEY_PATH);
line 41: openssl_sign(’$header.$claims’, $signature, $pkey, ‘sha256’);

So I have my .p8 and my sendPushes.php in my desktop.

Just try to review the path and seems ok, I think


#2

On your line two you’ve got an apostrophe character instead of the single quote character. See how they’re slightly angled? Please delete both those characters and replace with the ’ character and you should be good to go.


#3

Hi, I have the same warning: openssl_sign(): supplied key param cannot be coerced into a private key in /Users/…/serverPushes.php

Any ideas on how to solve this problem?


#4

Did you see my reply to the original post about the wrong apostrophe character being used? If that’s not the case for you please show your code.