0

when executing code in the terminal it gets such an error

class checkFB {


    public function curlSend ()
    {
        $handle = curl_init();
 
        $url = "https://www.facebook.com/";
 
        // Set the url
        curl_setopt($handle, CURLOPT_URL, $url);
        // Set the result output to be a string.
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
 
        $output = curl_exec($handle);
 
        curl_close($handle);
 
        echo $output;
    }


    public function test()
    {

        $this->curlSend();
    }
}

$oFb = new checkFB();
$oFb -> test();


OS: 19.6.0 Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64 x86_64

php -v
PHP 7.4.8 (cli) (built: Jul 30 2020 02:10:12) ( NTS )
php check.php
zsh: illegal hardware instruction  php check.php

please help :(

  • Strange: The error message Looks as if it came from the loader, which would mean that the PHP executable is broken. But in this case, I wouldn't expect that `php -v` would work either. Does the error occur even with a simple 'hello world' PHP program? – user1934428 Aug 04 '20 at 07:45
  • if we do this, http is working jelsi with https does not work $url = "https://www.facebook.com/"; – Sylwek Larog Aug 04 '20 at 14:17
  • Sorry, I did not really understand your loast comment. What does "jelsi with" mean? – user1934428 Aug 05 '20 at 06:27
  • if use http code work. if use https illegal :( – Sylwek Larog Aug 05 '20 at 15:44
  • Get it now. I think with https, you would have to set up a root certificate, as explained [here](https://stackoverflow.com/questions/9774349/php-curl-not-working-with-https#17409437). However, I still would not expect **this** error message showing up. If setting up the certificate doesn't help either, and reinstalling PHP also does not help, I would open a [bug report](https://bugs.php.net/). – user1934428 Aug 06 '20 at 06:34

0 Answers0