0

When I try make curl_exec, I got error:

WebCP FastCGI FAIL: No environment variables found.

Code:

  $body = 'text content';           
  $curl_url = 'https://example.org/api/';
  $myCurl = curl_init();
  $curl_headers = array('content-type' => 'text/plain');
  curl_setopt_array($myCurl, array(
    CURLOPT_URL => $curl_url,
    CURLOPT_HTTPHEADER => $curl_headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_POSTFIELDS => $body
  ));
  $response = curl_exec($myCurl);
  print_r($response);
  curl_close($myCurl);

PHP 7.4 Apache.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Itsukerka
  • 35
  • 6
  • **[You should not switch off `CURLOPT_SSL_VERIFYHOST` or `CURLOPT_SSL_VERIFYPEER`](https://paragonie.com/blog/2017/10/certainty-automated-cacert-pem-management-for-php-software)**. It could be a security risk! [Here is how to get the certificate bundle if your server is missing one](https://stackoverflow.com/a/32095378/1839439) – Dharman Aug 04 '20 at 12:18
  • Is this specific to PHP 7.4? Why did you add this tag? – Dharman Aug 04 '20 at 12:19
  • it's not because of CURLOPT_SSL_VERIFYPEER. I trying conn without CURLOPT_SSL_VERIFYPEER and got this error. PHP 7.4 - is my version php now. – Itsukerka Aug 04 '20 at 12:56

0 Answers0