尝试获取http post响应php时curl_setopt()错误

I have a code like this

    $payUrl = (some url);
    $postCheckData = 'CompanyCode=' . urlencode($companyCode) . '&ServiceCode=' . urlencode($serviceCode) and so on

    $chOne = curl_init( $payUrl );
    curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt( $ch, CURLOPT_POST, 1);
    curl_setopt( $ch, CURLOPT_POSTFIELDS, $postCheckData);
    curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt( $ch, CURLOPT_HEADER, 0);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
    $payResp = curl_exec( $chOne );
    curl_close ($chOne);
    print_r($payResp);

When I try to run this code, I get curl_setopt(): 248 is not a valid cURL handle resource What is this error? None of the solutions that I have searched worked for me.. What can be the possible problem? Please help

you initialise the curl request using $chOne = curl_init( $payUrl ); but then refer to $ch for all the other curl_setopt calls. I think it should look like this:

$payUrl = (some url);
$postCheckData = 'CompanyCode=' . urlencode($companyCode) . '&ServiceCode=' . urlencode($serviceCode) and so on

$chOne = curl_init( $payUrl );
curl_setopt( $chOne, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt( $chOne, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt( $chOne, CURLOPT_POST, 1);
curl_setopt( $chOne, CURLOPT_POSTFIELDS, $postCheckData);
curl_setopt( $chOne, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $chOne, CURLOPT_HEADER, 0);
curl_setopt( $chOne, CURLOPT_RETURNTRANSFER, 1);
$payResp = curl_exec( $chOne );
curl_close( $chOne );

print_r( $payResp );