signature – Locally Sign transactions Blockcypher API

I’m having a problem that I can’t solve since yesterday with the blockCypher APIs when I try to create a new transaction and submit it.

i have to sign locally but their php or cURL code don’t work (they give me several problems)

I searched the internet but found nothing suitable.
many signing tools found online tell me to enter a message in addition to the private key, what message should I enter? does not refer to any messages here:

# next, you sign the data returned in the tosign array locally
# any ECDSA secp256k1 signing tool should work
# $PRIVATEKEY here is a hex-encoded private key corresponding to the input from address 

sign: 32b5ea64c253b6b466366647458cfd60de9cd29d7dc542293aa0b8b7300cd827 $PRIVATEKEY


do you have any algorithm that i can use in php?